Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
Merge 115d255 into 5513664
Browse files Browse the repository at this point in the history
  • Loading branch information
SonataCI committed Jan 7, 2018
2 parents 5513664 + 115d255 commit 81a83b7
Show file tree
Hide file tree
Showing 63 changed files with 290 additions and 166 deletions.
6 changes: 6 additions & 0 deletions .php_cs.dist
Expand Up @@ -36,6 +36,12 @@ $rules = [
'@PHP56Migration' => true,
'@PHP56Migration:risky' => true,
'@PHPUnit57Migration:risky' => true,
'@PHP70Migration' => true,
'@PHP70Migration:risky' => true,
'@PHPUnit60Migration:risky' => true,
'@PHP71Migration' => true,
'@PHP71Migration:risky' => true,
'compact_nullable_typehint' => true,
// To be tested before insertion:
// 'strict_comparison' => true,
// 'strict_param' => true,
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Expand Up @@ -10,8 +10,6 @@ branches:
language: php

php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- nightly
Expand Down Expand Up @@ -43,7 +41,7 @@ matrix:
env: TARGET=docs
- php: '7.2'
env: TARGET=lint
- php: '5.6'
- php: '7.1'
env: COMPOSER_FLAGS="--prefer-lowest"
- php: '7.2'
env: SYMFONY=2.8.*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -16,7 +16,7 @@
}
],
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.1",
"doctrine/phpcr-bundle": "^1.3 || ^2.0",
"doctrine/phpcr-odm": "^1.4 || ^2.0",
"sonata-project/admin-bundle": "^3.30.1",
Expand Down
6 changes: 4 additions & 2 deletions src/Admin/Admin.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -40,7 +42,7 @@ class Admin extends AbstractAdmin
*
* @param string $rootPath
*/
public function setRootPath($rootPath)
public function setRootPath($rootPath): void
{
$this->rootPath = $rootPath;
}
Expand Down Expand Up @@ -131,7 +133,7 @@ public function toString($object)
/**
* @param RouteCollection $collection
*/
protected function configureRoutes(RouteCollection $collection)
protected function configureRoutes(RouteCollection $collection): void
{
foreach (['edit', 'create', 'delete'] as $name) {
if ($collection->has($name)) {
Expand Down
8 changes: 5 additions & 3 deletions src/Admin/FieldDescription.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -29,7 +31,7 @@ public function __construct()
* @throws \InvalidArgumentException if the mapping is no array or of an
* unknown type
*/
public function setAssociationMapping($associationMapping)
public function setAssociationMapping($associationMapping): void
{
if (!is_array($associationMapping)) {
throw new \InvalidArgumentException('The association mapping must be an array');
Expand Down Expand Up @@ -64,7 +66,7 @@ public function getTargetEntity()
*
* @throws \InvalidArgumentException if the mapping information is not an array
*/
public function setFieldMapping($fieldMapping)
public function setFieldMapping($fieldMapping): void
{
if (!is_array($fieldMapping)) {
throw new \InvalidArgumentException('The field mapping must be an array');
Expand Down Expand Up @@ -103,7 +105,7 @@ public function getValue($object)
* @throws \InvalidArgumentException if the list of mappings does contain
* something else than arrays
*/
public function setParentAssociationMappings(array $parentAssociationMappings)
public function setParentAssociationMappings(array $parentAssociationMappings): void
{
foreach ($parentAssociationMappings as $parentAssociationMapping) {
if (!is_array($parentAssociationMapping)) {
Expand Down
6 changes: 4 additions & 2 deletions src/Block/TreeBlockService.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -43,7 +45,7 @@ public function __construct($name, EngineInterface $templating, array $defaults
*
* NOOP as there is nothing to edit.
*/
public function buildEditForm(FormMapper $form, BlockInterface $block)
public function buildEditForm(FormMapper $form, BlockInterface $block): void
{
// there is nothing to edit here
}
Expand All @@ -62,7 +64,7 @@ public function execute(BlockContextInterface $blockContext, Response $response
/**
* {@inheritdoc}
*/
public function configureSettings(OptionsResolver $resolver)
public function configureSettings(OptionsResolver $resolver): void
{
// the callables are a workaround to make bundle configuration win over the default values
// see https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/pull/345
Expand Down
6 changes: 4 additions & 2 deletions src/Builder/DatagridBuilder.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -69,7 +71,7 @@ public function __construct(FormFactory $formFactory, FilterFactoryInterface $fi
/**
* @param PagerInterface $pager
*/
public function setPager(PagerInterface $pager)
public function setPager(PagerInterface $pager): void
{
$this->pager = $pager;
}
Expand All @@ -89,7 +91,7 @@ public function getPager()
/**
* {@inheritdoc}
*/
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription)
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription): void
{
// set default values
$fieldDescription->setAdmin($admin);
Expand Down
4 changes: 3 additions & 1 deletion src/Builder/FormContractor.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -39,7 +41,7 @@ public function __construct(FormFactoryInterface $formFactory)
*
* @throws \RuntimeException if the $fieldDescription does not specify a type
*/
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription)
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription): void
{
$metadata = null;
if ($admin->getModelManager()->hasMetadata($admin->getClass())) {
Expand Down
8 changes: 5 additions & 3 deletions src/Builder/ListBuilder.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -51,7 +53,7 @@ public function getBaseList(array $options = [])
/**
* {@inheritdoc}
*/
public function buildField($type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin)
public function buildField($type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin): void
{
if (null == $type) {
$guessType = $this->guesser->guessType($admin->getClass(), $fieldDescription->getName(), $admin->getModelManager());
Expand All @@ -66,7 +68,7 @@ public function buildField($type, FieldDescriptionInterface $fieldDescription, A
/**
* {@inheritdoc}
*/
public function addField(FieldDescriptionCollection $list, $type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin)
public function addField(FieldDescriptionCollection $list, $type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin): void
{
$this->buildField($type, $fieldDescription, $admin);
$admin->addListFieldDescription($fieldDescription->getName(), $fieldDescription);
Expand All @@ -79,7 +81,7 @@ public function addField(FieldDescriptionCollection $list, $type, FieldDescripti
*
* @throws \RuntimeException if the $fieldDescription does not have a type
*/
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription)
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription): void
{
if ('_action' == $fieldDescription->getName() || 'actions' === $fieldDescription->getType()) {
$this->buildActionFieldDescription($fieldDescription);
Expand Down
6 changes: 4 additions & 2 deletions src/Builder/ShowBuilder.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -51,7 +53,7 @@ public function getBaseList(array $options = [])
/**
* {@inheritdoc}
*/
public function addField(FieldDescriptionCollection $list, $type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin)
public function addField(FieldDescriptionCollection $list, $type, FieldDescriptionInterface $fieldDescription, AdminInterface $admin): void
{
if (null == $type) {
$guessType = $this->guesser->guessType($admin->getClass(), $fieldDescription->getName(), $admin->getModelManager());
Expand All @@ -73,7 +75,7 @@ public function addField(FieldDescriptionCollection $list, $type, FieldDescripti
*
* @throws \RuntimeException if the $fieldDescription does not have a type
*/
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription)
public function fixFieldDescription(AdminInterface $admin, FieldDescriptionInterface $fieldDescription): void
{
$fieldDescription->setAdmin($admin);

Expand Down
2 changes: 2 additions & 0 deletions src/Controller/AutocompleteController.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down
2 changes: 2 additions & 0 deletions src/Controller/TreeController.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down
4 changes: 3 additions & 1 deletion src/Datagrid/Pager.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -50,7 +52,7 @@ public function getResults($hydrationMode = null)
*
* @throws \RuntimeException the QueryBuilder is uninitialized
*/
public function init()
public function init(): void
{
if (!$this->getQuery()) {
throw new \RuntimeException('Uninitialized QueryBuilder');
Expand Down
10 changes: 6 additions & 4 deletions src/Datagrid/ProxyQuery.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down Expand Up @@ -112,7 +114,7 @@ public function getAlias()
/**
* @param string $root root path to restrict what documents to find
*/
public function setRootPath($root)
public function setRootPath($root): void
{
$this->root = $root;
}
Expand Down Expand Up @@ -208,7 +210,7 @@ public function getSortOrder()
*
* @throws \Exception
*/
public function getSingleScalarResult()
public function getSingleScalarResult(): void
{
/* TODO: Figure out who calls this method and what to do here in context of PHPCR */
throw new \Exception('Used by what??');
Expand Down Expand Up @@ -290,14 +292,14 @@ public function getDocumentManager()
return $this->documentManager;
}

public function getUniqueParameterId()
public function getUniqueParameterId(): void
{
}

/**
* @param array $associationMappings
*/
public function entityJoin(array $associationMappings)
public function entityJoin(array $associationMappings): void
{
}
}
4 changes: 3 additions & 1 deletion src/DependencyInjection/Compiler/AddGuesserCompilerPass.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand All @@ -26,7 +28,7 @@ class AddGuesserCompilerPass implements CompilerPassInterface
*
* Add tagged sonata guessers to their respective builders.
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
// ListBuilder
$definition = $container->getDefinition('sonata.admin.guesser.doctrine_phpcr_list_chain');
Expand Down
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand All @@ -23,7 +25,7 @@ class AddTemplatesCompilerPass implements CompilerPassInterface
/**
* @param ContainerBuilder $container
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$settings = $this->fixSettings($container);
foreach ($container->findTaggedServiceIds('sonata.admin') as $id => $attributes) {
Expand Down
8 changes: 5 additions & 3 deletions src/DependencyInjection/Compiler/AddTreeBrowserAssetsPass.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand All @@ -25,7 +27,7 @@ final class AddTreeBrowserAssetsPass implements CompilerPassInterface
/**
* {@inheritdoc}
*/
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('sonata.admin.pool')) {
return;
Expand All @@ -35,7 +37,7 @@ public function process(ContainerBuilder $container)
$this->addFormResources($container);
}

private function addAssetsToAdminPool(Definition $definition)
private function addAssetsToAdminPool(Definition $definition): void
{
$options = $definition->getArgument(3);
$options['javascripts'][] = 'bundles/cmftreebrowser/js/cmf_tree_browser.fancytree.js';
Expand All @@ -44,7 +46,7 @@ private function addAssetsToAdminPool(Definition $definition)
$definition->replaceArgument(3, $options);
}

private function addFormResources(ContainerBuilder $container)
private function addFormResources(ContainerBuilder $container): void
{
$resources = $container->getParameter('twig.form.resources');
$resources[] = 'SonataDoctrinePHPCRAdminBundle:Form:tree_browser_fields.html.twig';
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/*
* This file is part of the Sonata Project package.
*
Expand Down

0 comments on commit 81a83b7

Please sign in to comment.