Dependencies not installable

  • Critical
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/composer.dependencies_not_installable

SensioLabsInsight was not able to install your Composer dependencies. If you need to customize files or run commands to make it work, you can edit your SensioLabsInsight project configuration to override the default "pre_composer_script" and/or "post_composer_script" settings.

Time to fix: about 3 hours
Open Issue Permalink
Collective
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - phpspec/prophecy 1.6.x-dev requires sebastian/comparator ^1.1 -> no matching package found.
    - phpspec/prophecy 1.6.x-dev requires sebastian/comparator ^1.1 -> no matching package found.
    - Installation request for phpspec/prophecy 1.6.x-dev -> satisfiable by phpspec/prophecy[1.6.x-dev].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

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

  • Major
  • Bugrisk

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

  1. use \Charcoal\Translation\Catalog\ResourceInterface;
  2. /**
  3. *
  4. */
  5. class Resource extends AbstractConfig implements ResourceInterface

    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 Chauncey McAskill
  6. {
  7. /**
  8. * Disable key-notation.
  9. *
  10. * @var string

Source code should not contain TODO comments 14

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/task_todo_comment

  1. }
  2. /**
  3. * Recursively retrieve the files from the given directory.
  4. *
  5. * @todo Add maximum depth property.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @param string $path The path of a directory.
  7. * @return array|boolean
  8. */
  9. public function expandPath($path)
  10. {
  1. * Create one or more new instances of LanguageInterface.
  2. *
  3. * @param array $langs A list of language identifiers to create.
  4. * @throws InvalidArgumentException If no languages are passed.
  5. * @return LanguageInterface[]
  6. * @todo Implement Factory

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. */
  8. public function make(array $langs)
  9. {
  10. if (!count($langs)) {
  11. throw new InvalidArgumentException(
  1. /**
  2. * Load the metadata from JSON files.
  3. *
  4. * @return array
  5. * @todo [mcaskill 2016-02-11] Add support for directories.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. */
  7. public function loadFromRepositories()
  8. {
  9. $paths = $this->paths();
  1. * Registers services on the given container.
  2. *
  3. * This method should only be used to configure services and parameters.
  4. * It should not get services.
  5. *
  6. * @todo [mcaskill 2016-02-11] Implement translation drivers (Database, File, Yandex)

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * similar to CacheServiceProvider.
  8. * @todo [mcaskill 2016-03-07] Implement a 'setCurrentLanguage' that will update
  9. * the environment's locale and our Container's TranslationConfig singeton.
  10. * For now, you need to call:
  11. *
  1. * This method should only be used to configure services and parameters.
  2. * It should not get services.
  3. *
  4. * @todo [mcaskill 2016-02-11] Implement translation drivers (Database, File, Yandex)
  5. * similar to CacheServiceProvider.
  6. * @todo [mcaskill 2016-03-07] Implement a 'setCurrentLanguage' that will update

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * the environment's locale and our Container's TranslationConfig singeton.
  8. * For now, you need to call:
  9. *
  10. * ```php
  11. * // Handles setlocale()
  1. return $catalog;
  2. };
  3. /**
  4. * @todo Figure this shit out!

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  5. */
  6. TranslationConfig::setInstance($container['translator/locales']);
  7. }
  8. }
  1. * Retrieve the object's default language identifier.
  2. *
  3. * The default language acts as a fallback when the current language
  4. * is not available. This is especially useful when dealing with translations.
  5. *
  6. * @todo [mcaskill 2016-02-11] Replace with `self::fallbackLanguages()`

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * @return string A language identifier.
  8. */
  9. public function defaultLanguage();
  10. /**
  1. }
  2. $file = fopen($this->outputFile(), 'r');
  3. if (!$file) {
  4. /** @todo Throw exception? */

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  5. return $messages;
  6. }
  7. $cli = $this->climate();
  8. $merge = $this->languageMergeStrategy();
  1. * Retrieve the object's default language identifier.
  2. *
  3. * The default language acts as a fallback when the current language
  4. * is not available. This is especially useful when dealing with translations.
  5. *
  6. * @todo Replace with `self::fallbackLanguages()`

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * @return string A language identifier.
  8. */
  9. public function defaultLanguage()
  10. {
  11. if (!isset($this->defaultLanguage)) {
  1. }
  2. /**
  3. * Assign a global instance of TranslationConfig for sharing a locale setup.
  4. *
  5. * @todo [mcaskill 2015-12-07] This method must be replaced with equivalence in app Container.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. * @param TranslationConfig $config A TranslationConfig instance.
  7. * @return void
  8. */
  9. public static function setInstance(TranslationConfig $config)
  10. {
  1. *
  2. * @see AbstractSource::addFilter() Similar implementation.
  3. * @see AbstractProperty::fields() Similar implementation.
  4. * @see ConfigurableInterface::createConfig() Similar method.
  5. *
  6. * @todo This method needs to be deprecated.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * @param array|string|null $data Optional data to pass to the new TranslationConfig instance.
  8. * @return TranslationConfig
  9. */
  10. public static function instance($data = null)
  11. {
  1. * If $lang isn't provided, the translation in the current language is returned.
  2. *
  3. * @param LanguageInterface|string|null $lang Optional supported language to retrieve a translation in.
  4. * @return string
  5. * @throws InvalidArgumentException If language is invalid.
  6. * @todo When the language is invalid, should we fallback to the default language

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * or throw an InvalidArgumentException.
  8. */
  9. public function val($lang = null)
  10. {
  11. if ($lang === null) {
  1. /**
  2. * Get the array of translations in all languages.
  3. *
  4. * @return string[]
  5. *
  6. * @todo Add support for retrieving a subset of translations.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. */
  8. public function all()
  9. {
  10. return $this->val;
  11. }
  1. /**
  2. * Alias of `self::setTypes([ $type ])`
  3. *
  4. * Set the driver type of translator to use.
  5. *
  6. * @todo Implement translation drivers (Database, File, Yandex) similar to CacheServiceProvider.

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. * @param string $type A translation driver to try using.
  8. * @return self
  9. */
  10. public function setType($type)
  11. {

Object parameters should be type hinted

  • Minor
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.object_parameter_not_type_hinted

  1. }
  2. $directory = new RecursiveDirectoryIterator($path);
  3. $filter = new RecursiveCallbackFilterIterator(
  4. $directory,
  5. function ($current, $key, $iterator) {

    The parameter current, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. $filename = $current->getFilename();
  7. if (preg_match('!^(\.\w+|\.$|\.\.$)!i', $filename)) {
  8. return false;
  9. }

Unused method, property, variable or parameter 2

  • Minor
  • Deadcode

More information: https://insight.sensiolabs.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. if ($i === 0) {
  2. $i++;
  3. $source = $data[0];
  4. $count = count($data);
  5. $context = $data[( $count-1 )];

    This context local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. /**
  7. * Remove "ident" and "context" columns.
  8. * The rest of the columns are the available languages
  9. */
  1. );
  2. }
  3. $this->setIdent($langs);
  4. $index = $this->load();

    This index local variable is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  5. return [];
  6. }
  7. /**

Unused use statement should be avoided 5

  • Minor
  • Deadcode

More information: https://insight.sensiolabs.com/what-we-analyse/php.unused_use_statement

  1. use \RuntimeException;
  2. use \InvalidArgumentException;
  3. use \RecursiveIteratorIterator;
  4. use \RecursiveDirectoryIterator;
  5. use \RecursiveCallbackFilterIterator;
  6. use \SplFileInfo;

    The class SplFileInfo is declared but never used. You should remove the use statement.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. use \Traversable;
  8. // From Pimple
  9. use \Pimple\Container;
  1. use \RecursiveCallbackFilterIterator;
  2. use \SplFileInfo;
  3. use \Traversable;
  4. // From Pimple
  5. use \Pimple\Container;

    The class Pimple\Container is declared but never used. You should remove the use statement.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  6. // From PSR-6
  7. use \Psr\Cache\CacheItemPoolInterface;
  8. // From 'charcoal-core'
  1. use \RuntimeException;
  2. use \InvalidArgumentException;
  3. // From Pimple
  4. use \Pimple\Container;

    The class Pimple\Container is declared but never used. You should remove the use statement.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  5. // From PSR-6
  6. use \Psr\Cache\CacheItemPoolInterface;
  7. // From 'charcoal-core'
  1. <?php
  2. namespace Charcoal\Polyglot;
  3. use \InvalidArgumentException;

    The class InvalidArgumentException is declared but never used. You should remove the use statement.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  4. // Local Dependencies
  5. use \Charcoal\Language\LanguageInterface;
  6. /**
  1. // Dependencies from `charcoal-translation`
  2. use \Charcoal\Language\Language;
  3. use \Charcoal\Language\LanguageRepository;
  4. use \Charcoal\Translation\Catalog\Catalog;
  5. use \Charcoal\Translation\Catalog\Resource;
  6. use \Charcoal\Translation\Catalog\ResourceInterface;

    The class Charcoal\Translation\Catalog\ResourceInterface is declared but never used. You should remove the use statement.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Chauncey McAskill
  7. use \Charcoal\Translation\Catalog\ResourceRepository;
  8. use \Charcoal\Translation\TranslationConfig;
  9. // Intra-Module `charcoal-app` dependencies
  10. use \Charcoal\Translation\TranslatorConfig;

PHP classes should be short

  • Minor
  • Readability

More information: https://insight.sensiolabs.com/what-we-analyse/php.class_too_long

10% of all classes are larger than 500 lines. Split them up to keep less than 5% large classes.

Time to fix: about 3 hours
Open Issue Permalink
Collective