PHP 7 reserved words should not be used as class, interfaces or traits names

More information: https://insight.symfony.com/what-we-analyse/php.php7_reserved_words

  1. use lf4php\LoggerFactory;
  2. /**
  3. * @author Janos Szurovecz <szjani@szjani.hu>
  4. */
  5. abstract class Object implements ObjectInterface

    This name is a reserved word since PHP 7 and should not be used as class, interface or trait name.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Szurovecz János
  6. {
  7. /**
  8. * @return ObjectClass
  9. */
  10. final public static function objectClass()

User specific files should not appear in .gitignore

More information: https://insight.symfony.com/what-we-analyse/git.user_specific_ignored_file

in .gitignore, line 1
  1. nbproject/

    nbproject/ is user-specific and should not appear in a project .gitignore. Consider adding it to the user global .gitignore instead.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Szurovecz János
  2. /build/api
  3. /build/code-browser
  4. /build/coverage
  5. /build/logs
  6. /build/pdepend

Usage of a function in loops should be avoided 2

More information: https://insight.symfony.com/what-we-analyse/php.for_loop_uses_test_function

  1. * @throws \InvalidArgumentException if $numberToSkip is < 0
  2. */
  3. public static function advance(Iterator $iterator, $numberToSkip)
  4. {
  5. Preconditions::checkArgument(is_int($numberToSkip) && 0 <= $numberToSkip);
  6. for ($i = 0; $i < $numberToSkip && $iterator->valid(); $i++) {

    This loop uses a function. To avoid the overhead of executing the function n times, you should precalculate it before the loop.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Janos Szurovecz
  7. $iterator->next();
  8. }
  9. return $i;
  10. }
  1. }
  2. private function findNext()
  3. {
  4. $array = [];
  5. for ($i = 0; $i < $this->size && $this->getInnerIterator()->valid(); $this->getInnerIterator()->next(), $i++) {

    This loop uses a function. To avoid the overhead of executing the function n times, you should precalculate it before the loop.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Janos Szurovecz
  6. $array[] = $this->getInnerIterator()->current();
  7. }
  8. if ($this->padded) {
  9. $array = array_pad($array, $this->size, null);
  10. }

Class should be unique per PHP file 10

More information: https://insight.symfony.com/what-we-analyse/php.file_contains_more_than_one_class

This file contains 7 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 1.8 days
Open Issue Permalink
Last edited by Janos Szurovecz
  • Iterators (defined at line 40)
  • NoRewindNecessaryIterator (defined at line 450)
  • FilterIterator (defined at line 503)
  • TransformerIterator (defined at line 567)
  • ConcatIterator (defined at line 596)
  • NoRewindNecessaryLimitIterator (defined at line 662)
  • PartitionIterator (defined at line 701)

This file contains 3 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 6 hours
Open Issue Permalink
Last edited by Janos Szurovecz
  • BufferedIterable (defined at line 70)
  • BufferedIterator (defined at line 182)
  • FunctionalChunkProvider (defined at line 289)

This file contains 4 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 1 day
Open Issue Permalink
Last edited by Janos Szurovecz
  • Collections (defined at line 37)
  • ComparatorBasedHeap (defined at line 176)
  • ReverseComparator (defined at line 218)
  • CallableBasedComparator (defined at line 252)

This file contains 3 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 6 hours
Open Issue Permalink
Collective
  • ComparisonChain (defined at line 40)
  • ActiveComparisonChain (defined at line 93)
  • InactiveComparisonChain (defined at line 161)

This file contains 2 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 4 hours
Open Issue Permalink
Last edited by Janos Szurovecz

This file contains 4 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 1 day
Open Issue Permalink
Last edited by Janos Szurovecz

This file contains 3 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 6 hours
Open Issue Permalink
Last edited by Janos Szurovecz

This file contains 6 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 1.5 days
Open Issue Permalink
Last edited by Janos Szurovecz

This file contains 6 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 1.5 days
Open Issue Permalink
Last edited by Janos Szurovecz
  • Splitter (defined at line 71)
  • SimpleSplitter (defined at line 207)
  • PatternSplitter (defined at line 285)
  • FixedLengthSplitter (defined at line 344)
  • SimpleSplitIterator (defined at line 404)
  • FixedLengthSplitIterator (defined at line 473)

This file contains 2 classes. Keeping only one class per file is a standard in the PHP community, since it promotes interoperability and maintainability.

Time to fix: about 4 hours
Open Issue Permalink
Last edited by Janos Szurovecz