Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
updated coding standards and applied
Browse files Browse the repository at this point in the history
- added missing @param and @return annotations through the whole codebase
- see shopsys/shopsys#573
  • Loading branch information
grossmannmartin committed Dec 12, 2018
1 parent e22055c commit 56c6253
Show file tree
Hide file tree
Showing 81 changed files with 564 additions and 12 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"codeception/codeception": "^2.5.0",
"phpstan/phpstan": "^0.7",
"phpunit/phpunit": "^7.0",
"shopsys/coding-standards": "v7.0.0-beta2",
"shopsys/coding-standards": "v7.0.0-beta3",
"shopsys/http-smoke-testing": "v7.0.0-beta2"
},
"conflict": {
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Admin/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ class CustomerController extends BaseCustomerController
*/
protected $domainRouterFactory;

/**
* @param \Shopsys\FrameworkBundle\Model\Customer\UserDataFactoryInterface $userDataFactory
* @param \Shopsys\FrameworkBundle\Model\Customer\CustomerListAdminFacade $customerListAdminFacade
* @param \Shopsys\ShopBundle\Model\Customer\CustomerFacade $customerFacade
* @param \Shopsys\FrameworkBundle\Model\AdminNavigation\BreadcrumbOverrider $breadcrumbOverrider
* @param \Shopsys\FrameworkBundle\Model\Administrator\AdministratorGridFacade $administratorGridFacade
* @param \Shopsys\FrameworkBundle\Component\Grid\GridFactory $gridFactory
* @param \Shopsys\FrameworkBundle\Component\Domain\AdminDomainTabsFacade $adminDomainTabsFacade
* @param \Shopsys\FrameworkBundle\Model\Order\OrderFacade $orderFacade
* @param \Shopsys\FrameworkBundle\Model\Security\LoginAsUserFacade $loginAsUserFacade
* @param \Shopsys\FrameworkBundle\Component\Router\DomainRouterFactory $domainRouterFactory
* @param \Shopsys\FrameworkBundle\Model\Customer\CustomerDataFactoryInterface $customerDataFactory
* @param \Shopsys\ShopBundle\Model\Customer\BillingAddressFacade $billingAddressFacade
* @param \Shopsys\ShopBundle\Model\Customer\BillingAddressDataFactory $billingAddressDataFactory
* @param \Shopsys\FrameworkBundle\Model\Customer\UserFactory $userFactory
* @param \Shopsys\FrameworkBundle\Model\Customer\DeliveryAddressDataFactory $deliveryAddressDataFactory
* @param \Shopsys\FrameworkBundle\Model\Customer\DeliveryAddressFactory $deliveryAddressFactory
*/
public function __construct(
UserDataFactoryInterface $userDataFactory,
CustomerListAdminFacade $customerListAdminFacade,
Expand Down
3 changes: 3 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Admin/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

class LoginController extends BaseLoginController
{
/**
* @param \Shopsys\FrameworkBundle\Component\Router\DomainRouter $domainRouter
*/
private function changeDomainContext(DomainRouter $domainRouter)
{
$mainAdminDomainHost = $domainRouter->getContext()->getHost();
Expand Down
3 changes: 3 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/AdvertController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class AdvertController extends FrontBaseController
*/
private $advertFacade;

/**
* @param \Shopsys\FrameworkBundle\Model\Advert\AdvertFacade $advertFacade
*/
public function __construct(AdvertFacade $advertFacade)
{
$this->advertFacade = $advertFacade;
Expand Down
3 changes: 3 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ class ArticleController extends FrontBaseController
*/
private $articleFacade;

/**
* @param \Shopsys\FrameworkBundle\Model\Article\ArticleFacade $articleFacade
*/
public function __construct(ArticleFacade $articleFacade)
{
$this->articleFacade = $articleFacade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ class BestsellingProductController extends FrontBaseController
*/
private $currentCustomer;

/**
* @param \Shopsys\FrameworkBundle\Model\Product\BestsellingProduct\CachedBestsellingProductFacade $cachedBestsellingProductFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Customer\CurrentCustomer $currentCustomer
*/
public function __construct(
CachedBestsellingProductFacade $cachedBestsellingProductFacade,
Domain $domain,
Expand All @@ -35,6 +40,9 @@ public function __construct(
$this->currentCustomer = $currentCustomer;
}

/**
* @param \Shopsys\FrameworkBundle\Model\Category\Category $category
*/
public function listAction(Category $category)
{
$bestsellingProducts = $this->cachedBestsellingProductFacade->getAllOfferedBestsellingProducts(
Expand Down
3 changes: 3 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/BrandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class BrandController extends FrontBaseController
*/
private $brandFacade;

/**
* @param \Shopsys\FrameworkBundle\Model\Product\Brand\BrandFacade $brandFacade
*/
public function __construct(
BrandFacade $brandFacade
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class BreadcrumbController extends FrontBaseController
*/
private $breadcrumbResolver;

/**
* @param \Shopsys\FrameworkBundle\Component\Breadcrumb\BreadcrumbResolver $breadcrumbResolver
*/
public function __construct(
BreadcrumbResolver $breadcrumbResolver
) {
Expand Down
9 changes: 9 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ class CartController extends FrontBaseController
*/
private $errorService;

/**
* @param \Shopsys\FrameworkBundle\Model\Product\Accessory\ProductAccessoryFacade $productAccessoryFacade
* @param \Shopsys\FrameworkBundle\Model\Cart\CartFacade $cartFacade
* @param \Shopsys\FrameworkBundle\Model\Customer\CurrentCustomer $currentCustomer
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\TransportAndPayment\FreeTransportAndPaymentFacade $freeTransportAndPaymentFacade
* @param \Shopsys\FrameworkBundle\Model\Order\Preview\OrderPreviewFactory $orderPreviewFactory
* @param \Shopsys\FrameworkBundle\Component\FlashMessage\ErrorService $errorService
*/
public function __construct(
ProductAccessoryFacade $productAccessoryFacade,
CartFacade $cartFacade,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ class CategoryController extends FrontBaseController
*/
private $currentCustomer;

/**
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Category\CategoryFacade $categoryFacade
* @param \Shopsys\ShopBundle\Model\Category\CurrentCategoryResolver $currentCategoryResolver
* @param \Shopsys\FrameworkBundle\Model\Category\TopCategory\TopCategoryFacade $topCategoryFacade
* @param \Shopsys\FrameworkBundle\Model\Customer\CurrentCustomer $currentCustomer
*/
public function __construct(
Domain $domain,
CategoryFacade $categoryFacade,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class ContactFormController extends FrontBaseController
*/
private $domain;

/**
* @param \Shopsys\FrameworkBundle\Model\ContactForm\ContactFormFacade $contactFormFacade
* @param \Shopsys\FrameworkBundle\Model\LegalConditions\LegalConditionsFacade $legalConditionsFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
*/
public function __construct(
ContactFormFacade $contactFormFacade,
LegalConditionsFacade $legalConditionsFacade,
Expand Down
11 changes: 11 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ class CustomerController extends FrontBaseController
*/
private $customerDataFactory;

/**
* @param \Shopsys\FrameworkBundle\Model\Customer\CustomerFacade $customerFacade
* @param \Shopsys\FrameworkBundle\Model\Order\OrderFacade $orderFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Order\Item\OrderItemPriceCalculation $orderItemPriceCalculation
* @param \Shopsys\FrameworkBundle\Model\Security\LoginAsUserFacade $loginAsUserFacade
* @param \Shopsys\FrameworkBundle\Model\Customer\CustomerDataFactoryInterface $customerDataFactory
*/
public function __construct(
CustomerFacade $customerFacade,
OrderFacade $orderFacade,
Expand All @@ -60,6 +68,9 @@ public function __construct(
$this->customerDataFactory = $customerDataFactory;
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
public function editAction(Request $request)
{
if (!$this->isGranted(Roles::ROLE_LOGGED_CUSTOMER)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ class CustomerPasswordController extends FrontBaseController
*/
private $loginService;

/**
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Customer\CustomerPasswordFacade $customerPasswordFacade
* @param \Shopsys\FrameworkBundle\Model\Security\LoginService $loginService
*/
public function __construct(
Domain $domain,
CustomerPasswordFacade $customerPasswordFacade,
Expand All @@ -36,6 +41,9 @@ public function __construct(
$this->loginService = $loginService;
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
public function resetPasswordAction(Request $request)
{
$form = $this->createForm(ResetPasswordFormType::class);
Expand Down Expand Up @@ -72,6 +80,9 @@ public function resetPasswordAction(Request $request)
]);
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
public function setNewPasswordAction(Request $request)
{
$email = $request->query->get('email');
Expand Down
6 changes: 6 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/ErrorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ class ErrorController extends FrontBaseController
*/
private $domain;

/**
* @param \Shopsys\FrameworkBundle\Component\Error\ExceptionController $exceptionController
* @param \Shopsys\FrameworkBundle\Component\Error\ExceptionListener $exceptionListener
* @param \Shopsys\FrameworkBundle\Component\Error\ErrorPagesFacade $errorPagesFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
*/
public function __construct(
ExceptionController $exceptionController,
ExceptionListener $exceptionListener,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class HomepageController extends FrontBaseController
*/
private $domain;

/**
* @param \Shopsys\FrameworkBundle\Model\Customer\CurrentCustomer $currentCustomer
* @param \Shopsys\FrameworkBundle\Model\Slider\SliderItemFacade $sliderItemFacade
* @param \Shopsys\FrameworkBundle\Model\Product\TopProduct\TopProductFacade $topProductsFacade
* @param \Shopsys\FrameworkBundle\Model\Seo\SeoSettingFacade $seoSettingFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
*/
public function __construct(
CurrentCustomer $currentCustomer,
SliderItemFacade $sliderItemFacade,
Expand Down
10 changes: 10 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ class ImageController extends FrontBaseController
*/
private $filesystem;

/**
* @param \Shopsys\FrameworkBundle\Component\Image\Processing\ImageGeneratorFacade $imageGeneratorFacade
* @param \League\Flysystem\FilesystemInterface $filesystem
*/
public function __construct(ImageGeneratorFacade $imageGeneratorFacade, FilesystemInterface $filesystem)
{
$this->imageGeneratorFacade = $imageGeneratorFacade;
$this->filesystem = $filesystem;
}

/**
* @param mixed $entityName
* @param mixed $type
* @param mixed $sizeName
* @param mixed $imageId
*/
public function getImageAction($entityName, $type, $sizeName, $imageId)
{
if ($sizeName === ImageConfig::DEFAULT_SIZE_NAME) {
Expand Down
6 changes: 6 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@ class LoginController extends FrontBaseController
*/
private $loginService;

/**
* @param \Shopsys\FrameworkBundle\Model\Security\LoginService $loginService
*/
public function __construct(LoginService $loginService)
{
$this->loginService = $loginService;
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
public function loginAction(Request $request)
{
if ($this->isGranted(Roles::ROLE_LOGGED_CUSTOMER)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class NewsletterController extends FrontBaseController
*/
private $domain;

/**
* @param \Shopsys\FrameworkBundle\Model\Newsletter\NewsletterFacade $newsletterFacade
* @param \Shopsys\FrameworkBundle\Model\LegalConditions\LegalConditionsFacade $legalConditionsFacade
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
*/
public function __construct(
NewsletterFacade $newsletterFacade,
LegalConditionsFacade $legalConditionsFacade,
Expand Down
18 changes: 18 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ class OrderController extends FrontBaseController
*/
private $newsletterFacade;

/**
* @param \Shopsys\FrameworkBundle\Model\Order\OrderFacade $orderFacade
* @param \Shopsys\FrameworkBundle\Model\Cart\CartFacade $cartFacade
* @param \Shopsys\FrameworkBundle\Model\Order\Preview\OrderPreviewFactory $orderPreviewFactory
* @param \Shopsys\FrameworkBundle\Model\Transport\TransportPriceCalculation $transportPriceCalculation
* @param \Shopsys\FrameworkBundle\Model\Payment\PaymentPriceCalculation $paymentPriceCalculation
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Transport\TransportFacade $transportFacade
* @param \Shopsys\FrameworkBundle\Model\Payment\PaymentFacade $paymentFacade
* @param \Shopsys\FrameworkBundle\Model\Pricing\Currency\CurrencyFacade $currencyFacade
* @param \Shopsys\FrameworkBundle\Model\Order\OrderDataMapper $orderDataMapper
* @param \Shopsys\ShopBundle\Form\Front\Order\DomainAwareOrderFlowFactory $domainAwareOrderFlowFactory
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
* @param \Shopsys\FrameworkBundle\Model\Order\Watcher\TransportAndPaymentWatcherService $transportAndPaymentWatcherService
* @param \Shopsys\FrameworkBundle\Model\Order\Mail\OrderMailFacade $orderMailFacade
* @param \Shopsys\FrameworkBundle\Model\LegalConditions\LegalConditionsFacade $legalConditionsFacade
* @param \Shopsys\FrameworkBundle\Model\Newsletter\NewsletterFacade $newsletterFacade
*/
public function __construct(
OrderFacade $orderFacade,
CartFacade $cartFacade,
Expand Down
17 changes: 17 additions & 0 deletions src/Shopsys/ShopBundle/Controller/Front/PersonalDataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ class PersonalDataController extends FrontBaseController
*/
private $xmlResponse;

/**
* @param \Shopsys\FrameworkBundle\Component\Setting\Setting $setting
* @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain
* @param \Shopsys\FrameworkBundle\Model\Customer\CustomerFacade $customerFacade
* @param \Shopsys\FrameworkBundle\Model\Order\OrderFacade $orderFacade
* @param \Shopsys\FrameworkBundle\Model\Newsletter\NewsletterFacade $newsletterFacade
* @param \Shopsys\FrameworkBundle\Model\PersonalData\Mail\PersonalDataAccessMailFacade $personalDataAccessMailFacade
* @param \Shopsys\FrameworkBundle\Model\PersonalData\PersonalDataAccessRequestFacade $personalDataAccessRequestFacade
* @param \Shopsys\FrameworkBundle\Model\PersonalData\PersonalDataAccessRequestDataFactoryInterface $personalDataAccessRequestDataFactory
* @param \Shopsys\FrameworkBundle\Component\HttpFoundation\XmlResponse $xmlResponse
*/
public function __construct(
Setting $setting,
Domain $domain,
Expand All @@ -85,6 +96,9 @@ public function __construct(
$this->xmlResponse = $xmlResponse;
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
public function indexAction(Request $request)
{
$form = $this->createForm(
Expand Down Expand Up @@ -112,6 +126,9 @@ public function indexAction(Request $request)
]);
}

/**
* @param \Symfony\Component\HttpFoundation\Request $request
*/
public function exportAction(Request $request)
{
$form = $this->createForm(
Expand Down
Loading

0 comments on commit 56c6253

Please sign in to comment.