Skip to content

Conversation

@MusikAnimal
Copy link
Member

Loop through the block log to get the amount of time the user
was blocked.

Bug: https://phabricator.wikimedia.org/T174012

@codecov
Copy link

codecov bot commented Sep 27, 2017

Codecov Report

Merging #98 into master will increase coverage by 0.59%.
The diff coverage is 90.74%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #98      +/-   ##
==========================================
+ Coverage   23.28%   23.87%   +0.59%     
==========================================
  Files          30       30              
  Lines        3569     3602      +33     
==========================================
+ Hits          831      860      +29     
- Misses       2738     2742       +4
Impacted Files Coverage Δ
src/Xtools/EditCounter.php 53.22% <90.74%> (+3.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3245af2...82e2f1f. Read the comment docs.

@MusikAnimal MusikAnimal force-pushed the longest-block-T174012 branch 3 times, most recently from 460b108 to ac7e1b8 Compare September 27, 2017 21:58
if ($block['log_action'] === 'block') {
// This is a new block, so first see if the duration of the last
// block exceeded our longest duration. -1 duration means indefinite.
if ($lastBlock[1] > $this->longestBlockSeconds || $lastBlock[1] === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first time this loop executes, it's going to throw an undefined variable notice about $lastBlock[1]. Shouldn't $lastBlock = [$timestamp, $duration]; happen earlier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to set the timestamp and duration yet, but you're right the initial declaration should be like $lastBlock = [null, null]

Loop through the block log to get the amount of time the user
was blocked.

Bug: https://phabricator.wikimedia.org/T174012
@MusikAnimal
Copy link
Member Author

Code review concerns addressed; going to go ahead and merge so I can get this and T177172 deployed, hope that's OK

@MusikAnimal MusikAnimal merged commit 15ffeb0 into master Oct 2, 2017
@MusikAnimal MusikAnimal deleted the longest-block-T174012 branch October 2, 2017 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants