diff --git a/app/Resources/views/base.html.twig b/app/Resources/views/base.html.twig index bd0230c..ca28232 100644 --- a/app/Resources/views/base.html.twig +++ b/app/Resources/views/base.html.twig @@ -82,14 +82,7 @@ {% endfor %} - {#
#} - {#
#} - - {#
#} - {#
#}

{% block header %}{% endblock %}

- {#
#} - {#
#} {% for label, flashes in app.session.flashbag.all %} {% for flash in flashes %} diff --git a/app/Resources/views/model/index.html.twig b/app/Resources/views/model/index.html.twig index b47d304..a8ba0af 100644 --- a/app/Resources/views/model/index.html.twig +++ b/app/Resources/views/model/index.html.twig @@ -20,33 +20,35 @@ {% block content %}
-
-
-

{{ 'model.filter.title' | trans }}

- {{ form_start(form) }} -
- {{ form_label(form.query) }} -
- {{ form_widget(form.query) }} - -
+
+
+

{{ 'model.filter.title' | trans }}

+ {{ form_start(form) }} +
+ {{ form_label(form.query) }} +
+ {{ form_widget(form.query) }} +
- {{ form_row(form.category) }} -
- -
- {{ form_end(form) }}
+ {{ form_row(form.category) }} +
+ +
+ {{ form_end(form) }}
-
-
-
-
+
+
+
+
+
+ {% if models.paginationData['totalCount'] %} + {% endif %}
@@ -56,22 +58,23 @@ {{ knp_pagination_sortable(models, 'Name', 'm.name') }}
-
-
-
-
- {% for model in models %} - {{ blocks.model(model) }} - {% else %} - {{ blocks.empty('empty.search.title' | trans )}} - {% endfor %} -
-
-
- {{ knp_pagination_render(models) }} +
+
+
+ {% for model in models %} + {{ blocks.model(model) }} + {% else %} + {{ blocks.empty('empty.search.title' | trans )}} + {% endfor %} +
+
+
+ {{ knp_pagination_render(models) }} +
+
{% endblock %} diff --git a/app/Resources/views/set/index.html.twig b/app/Resources/views/set/index.html.twig index 26b9f37..8b9ad54 100644 --- a/app/Resources/views/set/index.html.twig +++ b/app/Resources/views/set/index.html.twig @@ -51,10 +51,12 @@
- + {% if sets.paginationData['totalCount'] %} + + {% endif %}
@@ -67,6 +69,7 @@ {{ knp_pagination_sortable(sets, 'Parts', ['s.partCount']) }}
+
diff --git a/src/AppBundle/Api/Client/Brickset/BricksetClient.php b/src/AppBundle/Api/Client/Brickset/BricksetClient.php index 89d0b98..192ce49 100644 --- a/src/AppBundle/Api/Client/Brickset/BricksetClient.php +++ b/src/AppBundle/Api/Client/Brickset/BricksetClient.php @@ -42,7 +42,7 @@ class BricksetClient /** * BricksetClient constructor. * - * @param string $apikey Brickset API key + * @param string $apiKey Brickset API key * @param array $options A array of config values * * @throws ApiException diff --git a/src/AppBundle/Command/LoadLdrawCommand.php b/src/AppBundle/Command/LoadLdrawCommand.php index 88117ae..f4f26f2 100644 --- a/src/AppBundle/Command/LoadLdrawCommand.php +++ b/src/AppBundle/Command/LoadLdrawCommand.php @@ -98,5 +98,7 @@ class LoadLdrawCommand extends ContainerAwareCommand } $this->release(); + + return 0; } } diff --git a/src/AppBundle/Controller/AjaxController.php b/src/AppBundle/Controller/AjaxController.php index ed8830e..6a56d12 100644 --- a/src/AppBundle/Controller/AjaxController.php +++ b/src/AppBundle/Controller/AjaxController.php @@ -11,6 +11,9 @@ class AjaxController extends AbstractController { /** * @Route("/set_tab/{tab}", name="set_tab", requirements={"tab"=".+"}) + * @param Request $request + * @param $tab + * @return Response */ public function setDefaultTabAction(Request $request, $tab) { diff --git a/src/AppBundle/Controller/ColorController.php b/src/AppBundle/Controller/ColorController.php index 2662b54..5372a9e 100644 --- a/src/AppBundle/Controller/ColorController.php +++ b/src/AppBundle/Controller/ColorController.php @@ -17,6 +17,8 @@ class ColorController extends AbstractController { /** * @Route("/", name="color_index") + * @param ColorService $colorService + * @return \Symfony\Component\HttpFoundation\Response */ public function indexAction(ColorService $colorService) { diff --git a/src/AppBundle/Entity/Color.php b/src/AppBundle/Entity/Color.php index e1db0ad..38a5379 100644 --- a/src/AppBundle/Entity/Color.php +++ b/src/AppBundle/Entity/Color.php @@ -135,8 +135,7 @@ class Color } /** - * @param Inventory_Part $part_building_kit - * + * @param Inventory_Part $inventoryPart * @return Color */ public function addPartInventoryPart(Inventory_Part $inventoryPart) @@ -147,7 +146,7 @@ class Color } /** - * @param Inventory_Part $part_building_kit + * @param Inventory_Part $inventoryPart * * @return Color */ diff --git a/src/AppBundle/Entity/LDraw/Model.php b/src/AppBundle/Entity/LDraw/Model.php index 3623892..fb6b8b2 100644 --- a/src/AppBundle/Entity/LDraw/Model.php +++ b/src/AppBundle/Entity/LDraw/Model.php @@ -166,6 +166,8 @@ class Model /** * @param string $name + * + * @return Model */ public function setName($name) { diff --git a/src/AppBundle/Entity/Rebrickable/Inventory_Part.php b/src/AppBundle/Entity/Rebrickable/Inventory_Part.php index b36fdfd..ff5dcc3 100644 --- a/src/AppBundle/Entity/Rebrickable/Inventory_Part.php +++ b/src/AppBundle/Entity/Rebrickable/Inventory_Part.php @@ -48,20 +48,6 @@ class Inventory_Part */ protected $inventory; - /** - * Set count. - * - * @param int $count - * - * @return Inventory_Part - */ - public function setCount($count) - { - $this->count = $count; - - return $this; - } - /** * Get count. * diff --git a/src/AppBundle/Form/Search/SetSearchType.php b/src/AppBundle/Form/Search/SetSearchType.php index 56d90c1..513135b 100644 --- a/src/AppBundle/Form/Search/SetSearchType.php +++ b/src/AppBundle/Form/Search/SetSearchType.php @@ -68,6 +68,7 @@ class SetSearchType extends AbstractType 'choice_label' => 'fullName', 'choice_translation_domain' => false, 'group_by' => function ($theme, $key, $index) { + /** @var Theme $theme */ $parent = $theme->getParent(); return $parent ? $parent->getParent() ? $parent->getParent()->getName() : $parent->getName() : $theme->getName(); diff --git a/src/AppBundle/Repository/ColorRepository.php b/src/AppBundle/Repository/ColorRepository.php index 2273a0d..49cb141 100644 --- a/src/AppBundle/Repository/ColorRepository.php +++ b/src/AppBundle/Repository/ColorRepository.php @@ -11,7 +11,7 @@ class ColorRepository extends BaseRepository { public function findAllBySet(Set $set) { - $inventory = $this->getEntityManager()->getRepository(Inventory::class)->findNewestInventoryBySetNumber($set->getNumber()); + $inventory = $this->getEntityManager()->getRepository(Inventory::class)->findNewestInventoryBySetNumber($set->getId()); $queryBuilder = $this->createQueryBuilder('color'); diff --git a/src/AppBundle/Repository/LDraw/SubpartRepository.php b/src/AppBundle/Repository/LDraw/SubpartRepository.php index 4f18363..e3b6bc6 100644 --- a/src/AppBundle/Repository/LDraw/SubpartRepository.php +++ b/src/AppBundle/Repository/LDraw/SubpartRepository.php @@ -16,8 +16,10 @@ class SubpartRepository extends BaseRepository /** * Create new Subpart relation entity or retrieve one by foreign keys. * - * @param $name - * + * @param $parent + * @param $child + * @param $count + * @param $colorId * @return Subpart */ public function getOrCreate($parent, $child, $count, $colorId) @@ -29,6 +31,7 @@ class SubpartRepository extends BaseRepository $colorRepository = $this->getEntityManager()->getRepository(Color::class); if (!($color = $colorRepository->find($colorId))) { + /** @var Color $color */ $color = $colorRepository->find(-1); } diff --git a/src/AppBundle/Repository/Search/SetRepository.php b/src/AppBundle/Repository/Search/SetRepository.php index 1ba3eb5..0f8bdb3 100644 --- a/src/AppBundle/Repository/Search/SetRepository.php +++ b/src/AppBundle/Repository/Search/SetRepository.php @@ -36,7 +36,7 @@ class SetRepository extends Repository $boolQuery->addMust($query); } else { - $query = new \Elastica\Query\MatchAll(); + $query = new Query\MatchAll(); $boolQuery->addMust($query); } diff --git a/src/AppBundle/Service/ColorService.php b/src/AppBundle/Service/ColorService.php index 61432e6..3f713b1 100644 --- a/src/AppBundle/Service/ColorService.php +++ b/src/AppBundle/Service/ColorService.php @@ -13,6 +13,7 @@ class ColorService /** * ColorService constructor. + * @param EntityManagerInterface $em */ public function __construct(EntityManagerInterface $em) { diff --git a/src/AppBundle/Service/Loader/BaseLoader.php b/src/AppBundle/Service/Loader/BaseLoader.php index 94f230e..4d53611 100644 --- a/src/AppBundle/Service/Loader/BaseLoader.php +++ b/src/AppBundle/Service/Loader/BaseLoader.php @@ -12,7 +12,6 @@ use Psr\Log\LoggerInterface; use Symfony\Component\Asset\Exception\LogicException; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Debug\Exception\ContextErrorException; abstract class BaseLoader { @@ -65,6 +64,7 @@ abstract class BaseLoader * Initialize new progress bar. * * @param $total + * @param string $format */ protected function initProgressBar($total, $format = 'loader') { diff --git a/src/AppBundle/Service/Loader/ImageLoader.php b/src/AppBundle/Service/Loader/ImageLoader.php index 9f91300..9167038 100644 --- a/src/AppBundle/Service/Loader/ImageLoader.php +++ b/src/AppBundle/Service/Loader/ImageLoader.php @@ -60,6 +60,7 @@ class ImageLoader extends BaseLoader // Get models without image $missing = []; $models = $this->em->getRepository(Model::class)->findAll(); + /** @var Model $model */ foreach ($models as $model) { if (!$this->mediaFilesystem->has('images'.DIRECTORY_SEPARATOR.'-1'.DIRECTORY_SEPARATOR.$model->getId().'.png')) { $missing[] = $model; diff --git a/src/AppBundle/Service/Loader/ModelLoader.php b/src/AppBundle/Service/Loader/ModelLoader.php index 2f9f701..ea400fe 100644 --- a/src/AppBundle/Service/Loader/ModelLoader.php +++ b/src/AppBundle/Service/Loader/ModelLoader.php @@ -134,7 +134,7 @@ class ModelLoader extends BaseLoader try { $connection->beginTransaction(); - $this->getFileContext($file); + $this->loadFileContext($file); $this->loadModel($file); $connection->commit(); @@ -206,6 +206,7 @@ class ModelLoader extends BaseLoader // Return model from database if rewrite is not enabled if (!$this->rewrite && $model = $modelRepository->find(basename($file, '.dat'))) { + /** @var Model $model */ return $model; } @@ -329,7 +330,6 @@ class ModelLoader extends BaseLoader * * * @param $id - * @param Filesystem $context * * @return string */ @@ -359,18 +359,14 @@ class ModelLoader extends BaseLoader * Get new filesystem context of current file. * * @param $file - * - * @return Filesystem */ - private function getFileContext($file) + private function loadFileContext($file) { try { $adapter = new Local(dirname($file)); $this->fileContext = new Filesystem($adapter); } catch (Exception $exception) { $this->logger->error($exception->getMessage()); - - return null; } } diff --git a/src/AppBundle/Util/LDModelParser.php b/src/AppBundle/Util/LDModelParser.php index 6911042..3c38630 100644 --- a/src/AppBundle/Util/LDModelParser.php +++ b/src/AppBundle/Util/LDModelParser.php @@ -27,9 +27,9 @@ class LDModelParser * * LDraw.org Standards: Official Library Header Specification (http://www.ldraw.org/article/398.html) * - * @throws ErrorParsingLineException - * + * @param $string * @return array + * @throws ErrorParsingLineException */ public function parse($string) {