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
Permalink
Collective
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 43 installs, 0 updates, 0 removals
  - Installing behat/transliterator (v1.2.0): Downloading (100%)
  - Installing doctrine/lexer (v1.0.1): Downloading (100%)
  - Installing doctrine/annotations (v1.5.0): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.5.0): Downloading (100%)
  - Installing twig/twig (v2.4.3): Downloading (100%)
  - Installing symfony/polyfill-util (v1.5.0): Downloading (100%)
  - Installing paragonie/random_compat (v2.0.10): Downloading (100%)
  - Installing symfony/polyfill-php70 (v1.5.0): Downloading (100%)
  - Installing symfony/polyfill-php56 (v1.5.0): Downloading (100%)
  - Installing symfony/symfony (v3.3.9): Downloading (100%)
  - Installing symfony/polyfill-intl-icu (v1.5.0): Downloading (100%)
  - Installing symfony/polyfill-apcu (v1.5.0): Downloading (100%)
  - Installing psr/simple-cache (1.0.0): Downloading (100%)
  - Installing psr/log (1.0.2): Downloading (100%)
  - Installing psr/link (1.0.0): Downloading (100%)
  - Installing psr/container (1.0.0): Downloading (100%)
  - Installing psr/cache (1.0.1): Downloading (100%)
  - Installing fig/link-util (1.0.0): Downloading (100%)
  - Installing doctrine/inflector (v1.2.0): Downloading (100%)
  - Installing doctrine/collections (v1.5.0): Downloading (100%)
  - Installing doctrine/cache (v1.7.1): Downloading (100%)
  - Installing doctrine/common (v2.8.1): Downloading (100%)
  - Installing jdorn/sql-formatter (v1.2.17): Downloading (100%)
  - Installing doctrine/doctrine-cache-bundle (1.3.0): Downloading (100%)
  - Installing doctrine/dbal (v2.6.2): Downloading (100%)
  - Installing doctrine/doctrine-bundle (1.7.0): Downloading (100%)
  - Installing doctrine/instantiator (1.0.5): Downloading (100%)
  - Installing doctrine/orm (v2.5.10): Downloading (100%)
  - Installing incenteev/composer-parameter-handler (v2.1.2): Downloading (100%)
  - Installing ninsuo/symfony-collection (2.1.11): Downloading (100%)
  - Installing composer/ca-bundle (1.0.8): Downloading (100%)
  - Installing sensiolabs/security-checker (v4.1.5): Downloading (100%)
  - Installing sensio/distribution-bundle (v5.0.21): Downloading (100%)
  - Installing sensio/framework-extra-bundle (v3.0.27): Downloading (100%)
  - Installing sourecode/assets (dev-master d6a4ad9): Downloading (100%)
  - Installing gedmo/doctrine-extensions (v2.4.30): Downloading (100%)
  - Installing stof/doctrine-extensions-bundle (v1.2.2): Downloading (100%)
  - Installing monolog/monolog (1.23.0): Downloading (100%)
  - Installing symfony/monolog-bundle (v3.1.0): Downloading (100%)
  - Installing swiftmailer/swiftmailer (v5.4.8): Downloading (100%)
  - Installing symfony/swiftmailer-bundle (v2.6.3): Downloading (100%)
  - Installing sensio/generator-bundle (v3.1.6): Downloading (100%)
  - Installing symfony/phpunit-bridge (v3.3.9): Downloading (100%)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
doctrine/doctrine-cache-bundle suggests installing symfony/security-acl (For using this bundle to cache ACLs)
sensio/framework-extra-bundle suggests installing symfony/psr-http-message-bridge (To use the PSR-7 converters)
gedmo/doctrine-extensions suggests installing doctrine/mongodb-odm (to use the extensions with the MongoDB ODM)
stof/doctrine-extensions-bundle suggests installing doctrine/mongodb-odm-bundle (to use the MongoDB ODM extensions)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
Generating optimized autoload files

                                                                                                         
  [RuntimeException]                                                                                     
  Could not scan for classes inside "app/AppKernel.php" which does not appear to be a file nor a folder  
                                                                                                         

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

The composer.json file should be valid

  • Major
  • Bugrisk

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

in composer.json, line 1
  1. {

    description : The property description is required

    Time to fix: about 1 hour
    Permalink
    Last edited by chapterjason
  2. "name": "sourecode/sourecode",
  3. "license": "MIT",
  4. "type": "library",
  5. "autoload": {
  6. "psr-4": {

Source code should not contain TODO comments 13

  • Minor
  • Architecture

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

  1. {% block content %}
  2. {% if check('content_page_edit') and check('content_page_delete') and check('content_page_index') %}
  3. <div class="d-flex align-items-center justify-content-between">
  4. <h2>{{ page.title }}</h2>
  5. {# @todo permission to go to the list #}

    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
    Permalink
    Last edited by chapterjason
  6. {# @todo permission to edit the page #}
  7. {# @todo permission to delete the page #}
  8. {{ form_start(delete_form) }}
  9. <div class="btn-group">
  10. <a href="{{ path('content_page_index') }}" class="btn btn-secondary"><span class="fa fa-fw fa-chevron-left"></span></a>
  1. {% if check('content_page_edit') and check('content_page_delete') and check('content_page_index') %}
  2. <div class="d-flex align-items-center justify-content-between">
  3. <h2>{{ page.title }}</h2>
  4. {# @todo permission to go to the list #}
  5. {# @todo permission to edit the page #}
  6. {# @todo permission to delete the page #}

    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
    Permalink
    Last edited by chapterjason
  7. {{ form_start(delete_form) }}
  8. <div class="btn-group">
  9. <a href="{{ path('content_page_index') }}" class="btn btn-secondary"><span class="fa fa-fw fa-chevron-left"></span></a>
  10. <a href="{{ path('content_page_edit', { 'slug': page.slug }) }}" class="btn btn-primary"><span class="fa fa-fw fa-edit"></span></a>
  11. <button type="submit" class="btn btn-danger"><span class="fa fa-fw fa-trash"></span></button>
  1. {% block content %}
  2. {% if check('content_page_edit') and check('content_page_delete') and check('content_page_index') %}
  3. <div class="d-flex align-items-center justify-content-between">
  4. <h2>{{ page.title }}</h2>
  5. {# @todo permission to go to the list #}
  6. {# @todo permission to edit the page #}

    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
    Permalink
    Last edited by chapterjason
  7. {# @todo permission to delete the page #}
  8. {{ form_start(delete_form) }}
  9. <div class="btn-group">
  10. <a href="{{ path('content_page_index') }}" class="btn btn-secondary"><span class="fa fa-fw fa-chevron-left"></span></a>
  11. <a href="{{ path('content_page_edit', { 'slug': page.slug }) }}" class="btn btn-primary"><span class="fa fa-fw fa-edit"></span></a>
  1. 'content_menu_route_delete',
  2. ]
  3. );
  4. $this->secureArray(
  5. $role_content_page,
  6. [ // @todo move to content bundle

    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
    Permalink
    Last edited by chapterjason
  7. 'content_page_index',
  8. 'content_page_new',
  9. 'content_page_edit',
  10. 'content_page_delete',
  11. ]
  1. $this->createRole('ROLE_ADMIN', ['ROLE_CONTENT']);
  2. $role_super_admin = $this->createRole('ROLE_SUPER_ADMIN', ['ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH']);
  3. $this->secureArray(
  4. $role_content_menu,
  5. [ // @todo move to content bundle

    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
    Permalink
    Last edited by chapterjason
  6. 'content_menu_index',
  7. 'content_menu_new',
  8. 'content_menu_show',
  9. 'content_menu_edit',
  10. 'content_menu_delete',
  1. 'content_page_delete',
  2. ]
  3. );
  4. $this->secureArray(
  5. $rolte_content_media,
  6. [ // @todo move to content bundle

    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
    Permalink
    Last edited by chapterjason
  7. 'content_directory_index',
  8. 'content_directory_new',
  9. 'content_directory_show',
  10. 'content_directory_edit',
  11. 'content_directory_delete',
  1. [ // @todo move to content bundle
  2. 'content_configuration_index',
  3. 'content_configuration_edit',
  4. ]
  5. );
  6. $this->secureArray($role_content, ['content_index']); // @todo move to content bundle

    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
    Permalink
    Last edited by chapterjason
  7. $this->secureArray(
  8. $role_super_admin,
  9. [ // @todo move to admin bundle
  10. 'admin_index',
  1. );
  2. $this->secureArray($role_content, ['content_index']); // @todo move to content bundle
  3. $this->secureArray(
  4. $role_super_admin,
  5. [ // @todo move to admin bundle

    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
    Permalink
    Last edited by chapterjason
  6. 'admin_index',
  7. 'admin_role_index',
  8. 'admin_role_new',
  9. 'admin_role_show',
  10. 'admin_role_edit',
  1. 'content_file_delete',
  2. ]
  3. );
  4. $this->secureArray(
  5. $role_content_configuration,
  6. [ // @todo move to content bundle

    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
    Permalink
    Last edited by chapterjason
  7. 'content_configuration_index',
  8. 'content_configuration_edit',
  9. ]
  10. );
  11. $this->secureArray($role_content, ['content_index']); // @todo move to content bundle
  1. * @param User $user
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function showAction(User $user)
  5. {
  6. // @todo acl

    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
    Permalink
    Last edited by chapterjason
  7. $deleteForm = $this->createDeleteForm($user);
  8. return $this->render(
  9. '@SoureCodeAdmin/Admin/User/show.html.twig',
  10. [
  1. * @param Page $page
  2. * @return \Symfony\Component\HttpFoundation\Response
  3. */
  4. public function showAction(Page $page)
  5. {
  6. // @todo acl

    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
    Permalink
    Last edited by chapterjason
  7. $deleteForm = $this->createDeleteForm($page);
  8. return $this->render(
  9. '@SoureCodeContent/Content/Page/show.html.twig',
  10. [
  1. * @param File $file
  2. * @return \Symfony\Component\HttpFoundation\BinaryFileResponse
  3. */
  4. public function showAction(File $file)
  5. {
  6. // @todo acl

    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
    Permalink
    Last edited by chapterjason
  7. $kernel = $this->get('kernel');
  8. $path = $kernel->getRootDir().'/../web/uploads/'.$file->getFile();
  9. $fileObject = new FileObject($path);
  10. return $this->file(
  1. return $role->getName();
  2. }
  3. )->toArray();
  4. }
  5. // @todo wait for deprecation of Role Object...

    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
    Permalink
    Last edited by chapterjason
  6. /**
  7. * @param null $security
  8. * @return ArrayCollection
  9. */

Code should not be duplicated 2

  • Minor
  • Architecture

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

  1. foreach ($this->menuRoutes as $menuRoute) {
  2. $entityManager->persist($menuRoute);
  3. }
  4. $entityManager->flush();

    The next 65 lines appear both in src/SoureCode/Bundle/AdminBundle/Command/InitCommand.php:75 and src/SoureCode/Bundle/ContentBundle/Command/InitCommand.php:111.

    Time to fix: about 4 hours
    Permalink
    Last edited by chapterjason
  5. }
  6. /**
  7. * @param $name
  8. * @return Menu
  1. /**
  2. * Class RoutePermissionType
  3. * @package SoureCode\Bundle\AdminBundle\Form
  4. */
  5. class RoutePermissionType extends AbstractType

    The next 46 lines appear both in src/SoureCode/Bundle/AdminBundle/Form/RoutePermissionType.php:30 and src/SoureCode/Bundle/ContentBundle/Form/MenuRouteType.php:26.

    Time to fix: about 4 hours
    Permalink
    Last edited by chapterjason
  6. {
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function buildForm(FormBuilderInterface $builder, array $options)

Object parameters should be type hinted 2

  • Minor
  • Bugrisk

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

  1. ->add(
  2. 'parent',
  3. EntityType::class,
  4. [
  5. 'class' => Directory::class,
  6. 'choice_label' => function ($directory) {

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

    Time to fix: about 1 hour
    Permalink
    Last edited by chapterjason
  7. /** @var Directory $directory */
  8. return $directory->getTitle().' ('.$directory->getSlug().')';
  9. },
  10. 'required' => false,
  11. ]
  1. * @return array The user roles
  2. */
  3. public function getRoles()
  4. {
  5. return $this->getReachableRoles()->map(
  6. function ($role) {

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

    Time to fix: about 1 hour
    Permalink
    Last edited by chapterjason
  7. /**
  8. * @var Role $role
  9. */
  10. return $role->getName();
  11. }

Version of dependencies should be fixed

  • Minor
  • Bugrisk

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

Package sourecode/assets#dev-master is not fixed.

Time to fix: about 1 hour
Permalink
Collective

Commented code should not be committed 5

  • Minor
  • Deadcode

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

  1. * {@inheritdoc}
  2. */
  3. public function load(array $configs, ContainerBuilder $container)
  4. {
  5. $configuration = new Configuration();
  6. // $config = $this->processConfiguration($configuration, $configs);

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Permalink
    Last edited by chapterjason
  7. $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
  8. $loader->load('services.yml');
  9. }
  1. * {@inheritdoc}
  2. */
  3. public function load(array $configs, ContainerBuilder $container)
  4. {
  5. $configuration = new Configuration();
  6. // $config = $this->processConfiguration($configuration, $configs);

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Permalink
    Last edited by chapterjason
  7. $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
  8. $loader->load('services.yml');
  9. }
  10. }
  1. // *
  2. // * @return RoutePermission
  3. // */
  4. // public function setAttribute($attribute)
  5. // {
  6. // $this->attribute = $attribute;

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Permalink
    Last edited by chapterjason
  7. //
  8. // return $this;
  9. // }
  10. //
  11. // /**
  1. // */
  2. // public function setAttribute($attribute)
  3. // {
  4. // $this->attribute = $attribute;
  5. //
  6. // return $this;

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Permalink
    Last edited by chapterjason
  7. // }
  8. //
  9. // /**
  10. // * Get attribute
  11. // *
  1. // *
  2. // * @return string
  3. // */
  4. // public function getAttribute()
  5. // {
  6. // return $this->attribute;

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Permalink
    Last edited by chapterjason
  7. // }
  8. /**
  9. * Get security
  10. *

Unused method, property, variable or parameter 6

  • Minor
  • Deadcode

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

  1. /**
  2. * {@inheritdoc}
  3. */
  4. public function load(array $configs, ContainerBuilder $container)
  5. {
  6. $configuration = new Configuration();

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

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. // $config = $this->processConfiguration($configuration, $configs);
  8. $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
  9. $loader->load('services.yml');
  10. }
  1. * {@inheritdoc}
  2. */
  3. public function getConfigTreeBuilder()
  4. {
  5. $treeBuilder = new TreeBuilder();
  6. $rootNode = $treeBuilder->root('soure_code_core');

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

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. return $treeBuilder;
  8. }
  9. }
  1. /**
  2. * {@inheritdoc}
  3. */
  4. public function load(array $configs, ContainerBuilder $container)
  5. {
  6. $configuration = new Configuration();

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

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. // $config = $this->processConfiguration($configuration, $configs);
  8. $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
  9. $loader->load('services.yml');
  10. }
  1. * {@inheritdoc}
  2. */
  3. public function getConfigTreeBuilder()
  4. {
  5. $treeBuilder = new TreeBuilder();
  6. $rootNode = $treeBuilder->root('soure_code_user');

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

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. // Here you should define the parameters that are allowed to
  8. // configure your bundle. See the documentation linked above for
  9. // more information on that topic.
  1. * {@inheritdoc}
  2. */
  3. public function getConfigTreeBuilder()
  4. {
  5. $treeBuilder = new TreeBuilder();
  6. $rootNode = $treeBuilder->root('soure_code_content');

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

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. return $treeBuilder;
  8. }
  9. }
  1. * {@inheritdoc}
  2. */
  3. public function getConfigTreeBuilder()
  4. {
  5. $treeBuilder = new TreeBuilder();
  6. $rootNode = $treeBuilder->root('soure_code_admin');

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

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. // Here you should define the parameters that are allowed to
  8. // configure your bundle. See the documentation linked above for
  9. // more information on that topic.

Usage of a function in loops should be avoided

  • Minor
  • Performance

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

  1. * @param callable $predicate
  2. * @return null|HistoryItem
  3. */
  4. public function getFirst(callable $predicate): ?HistoryItem
  5. {
  6. for (end($this->items); key($this->items) !== null; prev($this->items)) {

    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
    Permalink
    Last edited by chapterjason
  7. $historyItem = current($this->items);
  8. if ($predicate($historyItem)) {
  9. return $historyItem;
  10. }

Text files should end with a newline character 40

  • Info
  • Codestyle

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

  1. */
  2. public function getBlockPrefix()
  3. {
  4. return 'sourecode_bundle_corebundle_keyvalue';
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. services:
  2. # soure_code_admin.example:
  3. # class: SoureCode\Bundle\AdminBundle\Example
  4. # arguments: ["@service_id", "plain_value", "%parameter%"]

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. unlink($path);
  2. }
  3. }
  4. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. public function getParams(): array
  2. {
  3. return $this->params;
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. 'name': 'main',
  2. 'classes': 'navbar-nav'
  3. }})) }}
  4. </div>
  5. </div>
  6. </nav>

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. public function get(string $name): ?string
  2. {
  3. return array_key_exists($name, $this->widgets) ? $this->widgets[$name] : null;
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. soure_code_admin:
  2. resource: "@SoureCodeAdminBundle/Controller/"
  3. type: annotation
  4. prefix: /

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. * @param callable $predicate
  2. * @return null|HistoryItem
  3. */
  4. public function getFirst(callable $predicate): ?HistoryItem;
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. }
  2. return null;
  3. }
  4. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. */
  2. public function boot(array $configuration): void
  3. {
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. $definition = $container->getDefinition('widget_collection');
  2. $definition->addMethodCall('add', ['menu', MenuWidget::class]);
  3. }
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
in .gitignore, line 10
  1. var/
  2. vendor/
  3. web/
  4. *~
  5. composer.phar
  6. phpunit.phar

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. $this->cache->save($hierarchyCacheItem);
  2. }
  3. return $hierarchyCacheItem->get();
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. );
  2. $resolver->setAllowedTypes('allowed_keys', ['null', 'array']);
  3. }
  4. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. soure_code_content:
  2. resource: "@SoureCodeContentBundle/Controller/"
  3. type: annotation
  4. prefix: /

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. - { name: cache.pool }
  2. soure_code.content.cache:
  3. class: Symfony\Component\Cache\Adapter\TagAwareAdapter
  4. arguments: [ '@soure_code.content.cache.hidden']
  5. public: true

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. $url = str_replace($pathInfo, rtrim($pathInfo, ' /'), $requestUri);
  2. return $this->redirect($url, 301);
  3. }
  4. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. } else {
  2. return $this->redirectToRoute($route, ['slug' => $params]);
  3. }
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. * Class SoureCodeAssetBundle
  2. * @package SoureCode\Bundle\AssetBundle
  3. */
  4. class SoureCodeAssetBundle extends Bundle
  5. {
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
in .circleci/config.yml, line 40
  1. - save_cache:
  2. paths:
  3. - ./vendor
  4. key: v1-dependencies-{{ checksum "composer.json" }}
  5. - run: phpunit

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. {% extends '@SoureCodeContent/Content/default.html.twig' %}
  2. {% block content %}
  3. {{ form(form) }}
  4. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. throw new AccessDeniedException();
  2. }
  3. }
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. *
  2. * @param $configuration
  3. */
  4. public function boot(array $configuration): void;
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. [
  2. 'data_class' => User::class,
  3. ]
  4. );
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. twig.extension.check:
  2. class: SoureCode\Bundle\UserBundle\Twig\Extension\RoutePermission
  3. arguments: ['@soure_code.user.service.permission_manager']
  4. tags:
  5. - { name: twig.extension }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. public function getMenu(): Menu
  2. {
  3. return $this->menu;
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. $method = $request->getMethod();
  2. $this->historyBag->add($route, $method, $params);
  3. }
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. 'configuration': {
  2. 'name': 'content',
  3. 'pills': true,
  4. 'vertical': true
  5. }})) }}
  6. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. {% extends '@SoureCodeContent/Content/default.html.twig' %}
  2. {% block content %}
  3. {{ form(form) }}
  4. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. {% endblock %}
  2. {% block afterContent %}
  3. </div>
  4. </div>
  5. </div>
  6. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. soure_code_user:
  2. resource: "@SoureCodeUserBundle/Controller/"
  3. type: annotation
  4. prefix: /

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. $array[$data['key']] = $data['value'];
  2. }
  3. return $array;
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. {%- block beforeContent -%}
  2. <div class="container">
  3. {%- endblock -%}
  4. {%- block afterContent -%}
  5. </div>
  6. {%- endblock -%}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. </li>
  2. {% else %}
  3. {{ macros.render(item) }}
  4. {% endif %}
  5. {% endfor %}
  6. </ul>

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
in .travis.yml, line 8
  1. dist: trusty
  2. sudo: false
  3. php: 7.1.9
  4. install: composer install -n --prefer-dist
  5. script: phpunit

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. {% block beforeJavascript %}{% endblock %}
  2. <script src="{{ asset('/assets/js/sourecode.js') }}"></script>
  3. {% block afterJavascript %}{% endblock %}
  4. {% endblock %}
  5. </body>
  6. </html>

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. {% block sidebar %}
  2. {% endblock %}
  3. </div>
  4. </div>
  5. </div>
  6. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. }
  2. return true;
  3. }
  4. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. soure_code_core:
  2. resource: "@SoureCodeCoreBundle/Controller/"
  3. type: annotation
  4. prefix: /

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  1. 'configuration': {
  2. 'name': 'admin',
  3. 'pills': true,
  4. 'vertical': true
  5. }})) }}
  6. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason

PHP code should follow PSR-1 basic coding standard

  • Info
  • Codestyle

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

  1. * @param $object
  2. * @param $method
  3. * @param $attributes
  4. * @return mixed
  5. */
  6. public function call_user_func_array($object, $method, $attributes)

    Method names should be declared in camelCase.
    You should rename this method to comply with PSR-1.

    Time to fix: about 15 minutes
    Permalink
    Last edited by chapterjason
  7. {
  8. return call_user_func_array([$object, $method], $attributes);
  9. }
  10. /**