diff --git a/packages/framework/easy-coding-standard.yml b/packages/framework/easy-coding-standard.yml index 2906c177747..67d77d0a680 100644 --- a/packages/framework/easy-coding-standard.yml +++ b/packages/framework/easy-coding-standard.yml @@ -12,6 +12,7 @@ services: - Shopsys\FrameworkBundle\Model - Shopsys\FrameworkBundle\Component - Shopsys\FrameworkBundle\Controller + - Shopsys\FrameworkBundle\Twig Shopsys\CodingStandards\Sniffs\ConstantVisibilityRequiredSniff: ~ diff --git a/packages/framework/src/Twig/CookiesExtension.php b/packages/framework/src/Twig/CookiesExtension.php index 8d8d4fcc0e0..f60279e6c12 100644 --- a/packages/framework/src/Twig/CookiesExtension.php +++ b/packages/framework/src/Twig/CookiesExtension.php @@ -10,7 +10,7 @@ class CookiesExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Cookies\CookiesFacade */ - private $cookiesFacade; + protected $cookiesFacade; /** * @param \Shopsys\FrameworkBundle\Model\Cookies\CookiesFacade $cookiesFacade diff --git a/packages/framework/src/Twig/CssExtension.php b/packages/framework/src/Twig/CssExtension.php index f5ba092a4ed..44a3aa08b04 100644 --- a/packages/framework/src/Twig/CssExtension.php +++ b/packages/framework/src/Twig/CssExtension.php @@ -10,7 +10,7 @@ class CssExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Component\Css\CssFacade */ - private $cssFacade; + protected $cssFacade; /** * @param \Shopsys\FrameworkBundle\Component\Css\CssFacade $cssFacade diff --git a/packages/framework/src/Twig/DateTimeFormatterExtension.php b/packages/framework/src/Twig/DateTimeFormatterExtension.php index b071894776c..5ec412c7bdf 100644 --- a/packages/framework/src/Twig/DateTimeFormatterExtension.php +++ b/packages/framework/src/Twig/DateTimeFormatterExtension.php @@ -14,12 +14,12 @@ class DateTimeFormatterExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Component\Localization\DateTimeFormatter */ - private $dateTimeFormatter; + protected $dateTimeFormatter; /** * @var \Shopsys\FrameworkBundle\Model\Localization\Localization */ - private $localization; + protected $localization; /** * @param \Shopsys\FrameworkBundle\Component\Localization\DateTimeFormatter $dateTimeFormatter @@ -119,7 +119,7 @@ public function formatDateTime($dateTime, $locale = null) * @param string|null $locale * @return string */ - private function format($dateTime, $dateType, $timeType, $locale = null) + protected function format($dateTime, $dateType, $timeType, $locale = null) { if ($dateTime === null) { return '-'; @@ -137,7 +137,7 @@ private function format($dateTime, $dateType, $timeType, $locale = null) * @param string|null $locale * @return string */ - private function getLocale($locale = null) + protected function getLocale($locale = null) { if ($locale === null) { $locale = $this->localization->getLocale(); @@ -150,7 +150,7 @@ private function getLocale($locale = null) * @param mixed $value * @return \DateTime */ - private function convertToDateTime($value) + protected function convertToDateTime($value) { if ($value instanceof DateTime) { return $value; diff --git a/packages/framework/src/Twig/DomainExtension.php b/packages/framework/src/Twig/DomainExtension.php index 1a723f19d30..6c3e582a893 100644 --- a/packages/framework/src/Twig/DomainExtension.php +++ b/packages/framework/src/Twig/DomainExtension.php @@ -12,22 +12,22 @@ class DomainExtension extends \Twig_Extension /** * @var string */ - private $domainImagesUrlPrefix; + protected $domainImagesUrlPrefix; /** * @var \Symfony\Component\Asset\Packages */ - private $assetPackages; + protected $assetPackages; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @var \Shopsys\FrameworkBundle\Component\Domain\DomainFacade */ - private $domainFacade; + protected $domainFacade; /** * @param mixed $domainImagesUrlPrefix diff --git a/packages/framework/src/Twig/FileThumbnail/FileThumbnailExtension.php b/packages/framework/src/Twig/FileThumbnail/FileThumbnailExtension.php index a75fe63adb1..8e160575c27 100644 --- a/packages/framework/src/Twig/FileThumbnail/FileThumbnailExtension.php +++ b/packages/framework/src/Twig/FileThumbnail/FileThumbnailExtension.php @@ -16,17 +16,17 @@ class FileThumbnailExtension extends Twig_Extension /** * @var string[] */ - private $iconsByExtension; + protected $iconsByExtension; /** * @var \Shopsys\FrameworkBundle\Component\FileUpload\FileUpload */ - private $fileUpload; + protected $fileUpload; /** * @var \Shopsys\FrameworkBundle\Component\Image\Processing\ImageThumbnailFactory */ - private $imageThumbnailFactory; + protected $imageThumbnailFactory; /** * @param \Shopsys\FrameworkBundle\Component\FileUpload\FileUpload $fileUpload @@ -98,7 +98,7 @@ public function getFileThumbnailInfoByTemporaryFilename($temporaryFilename) * @param string $filepath * @return \Shopsys\FrameworkBundle\Twig\FileThumbnail\FileThumbnailInfo */ - private function getImageThumbnailInfo($filepath) + protected function getImageThumbnailInfo($filepath) { $image = $this->imageThumbnailFactory->getImageThumbnail($filepath); @@ -109,7 +109,7 @@ private function getImageThumbnailInfo($filepath) * @param string $filepath * @return string */ - private function getIconTypeByFilename($filepath) + protected function getIconTypeByFilename($filepath) { $extension = strtolower(pathinfo($filepath, PATHINFO_EXTENSION)); if (array_key_exists($extension, $this->iconsByExtension)) { diff --git a/packages/framework/src/Twig/FileThumbnail/FileThumbnailInfo.php b/packages/framework/src/Twig/FileThumbnail/FileThumbnailInfo.php index ae7893814c2..2d033386382 100644 --- a/packages/framework/src/Twig/FileThumbnail/FileThumbnailInfo.php +++ b/packages/framework/src/Twig/FileThumbnail/FileThumbnailInfo.php @@ -7,12 +7,12 @@ class FileThumbnailInfo /** * @var string|null */ - private $iconType; + protected $iconType; /** * @var string|null */ - private $imageUri; + protected $imageUri; /** * @param string|null $iconType diff --git a/packages/framework/src/Twig/FileUploadExtension.php b/packages/framework/src/Twig/FileUploadExtension.php index 188eacc9241..777753a6d58 100644 --- a/packages/framework/src/Twig/FileUploadExtension.php +++ b/packages/framework/src/Twig/FileUploadExtension.php @@ -11,7 +11,7 @@ class FileUploadExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Component\FileUpload\FileUpload */ - private $fileUpload; + protected $fileUpload; /** * @param \Shopsys\FrameworkBundle\Component\FileUpload\FileUpload $fileUpload diff --git a/packages/framework/src/Twig/FormDetailExtension.php b/packages/framework/src/Twig/FormDetailExtension.php index a2abe5555bf..9f9e945e7f0 100644 --- a/packages/framework/src/Twig/FormDetailExtension.php +++ b/packages/framework/src/Twig/FormDetailExtension.php @@ -12,7 +12,7 @@ class FormDetailExtension extends Twig_Extension /** * @var \Twig_Environment */ - private $twigEnvironment; + protected $twigEnvironment; /** * @param \Twig_Environment $twigEnvironment diff --git a/packages/framework/src/Twig/FormThemeExtension.php b/packages/framework/src/Twig/FormThemeExtension.php index 7a32a81f737..313d5eb60df 100644 --- a/packages/framework/src/Twig/FormThemeExtension.php +++ b/packages/framework/src/Twig/FormThemeExtension.php @@ -54,7 +54,7 @@ public function getDefaultFormTheme() * @param string $controller * @return bool */ - private function isAdmin(string $controller) : bool + protected function isAdmin(string $controller) : bool { return strpos($controller, 'Shopsys\FrameworkBundle\Controller\Admin') === 0 || strpos($controller, 'Shopsys\ShopBundle\Controller\Admin') === 0; diff --git a/packages/framework/src/Twig/HoneyPotExtension.php b/packages/framework/src/Twig/HoneyPotExtension.php index bf15556eb2a..d27df61cad4 100644 --- a/packages/framework/src/Twig/HoneyPotExtension.php +++ b/packages/framework/src/Twig/HoneyPotExtension.php @@ -48,7 +48,7 @@ public function formHoneyPotCheckPasswordAlreadyRendered(FormView $formView) * @param \Symfony\Component\Form\FormView $formView * @return \Symfony\Component\Form\FormView */ - private function getRootFormView(FormView $formView) + protected function getRootFormView(FormView $formView) { $rootFormView = $formView; @@ -63,7 +63,7 @@ private function getRootFormView(FormView $formView) * @param \Symfony\Component\Form\FormView $formView * @return bool */ - private function containsNotRenderedPassword(FormView $formView) + protected function containsNotRenderedPassword(FormView $formView) { foreach ($formView->children as $childForm) { if (strpos($childForm->vars['name'], static::PASSWORD_FIELD_NAME) !== false && !$childForm->isRendered()) { diff --git a/packages/framework/src/Twig/ImageExtension.php b/packages/framework/src/Twig/ImageExtension.php index b074a01d69d..2b172ee6942 100644 --- a/packages/framework/src/Twig/ImageExtension.php +++ b/packages/framework/src/Twig/ImageExtension.php @@ -20,7 +20,7 @@ class ImageExtension extends Twig_Extension /** * @var string */ - private $frontDesignImageUrlPrefix; + protected $frontDesignImageUrlPrefix; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain @@ -30,7 +30,7 @@ class ImageExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Component\Image\ImageLocator */ - private $imageLocator; + protected $imageLocator; /** * @var \Shopsys\FrameworkBundle\Component\Image\ImageFacade @@ -40,7 +40,7 @@ class ImageExtension extends Twig_Extension /** * @var \Symfony\Component\Templating\EngineInterface */ - private $templating; + protected $templating; /** * @param string $frontDesignImageUrlPrefix @@ -157,7 +157,7 @@ public function getNoimageHtml(array $attributes = []) /** * @return string */ - private function getEmptyImageUrl(): string + protected function getEmptyImageUrl(): string { return $this->domain->getUrl() . $this->frontDesignImageUrlPrefix . '/' . static::NOIMAGE_FILENAME; } @@ -168,7 +168,7 @@ private function getEmptyImageUrl(): string * @param string|null $sizeName * @return string */ - private function getImageCssClass($entityName, $type, $sizeName) + protected function getImageCssClass($entityName, $type, $sizeName) { $allClassParts = [ 'image', diff --git a/packages/framework/src/Twig/InputPriceLabelExtension.php b/packages/framework/src/Twig/InputPriceLabelExtension.php index d60eb79ae91..ecc1c333ea1 100644 --- a/packages/framework/src/Twig/InputPriceLabelExtension.php +++ b/packages/framework/src/Twig/InputPriceLabelExtension.php @@ -11,7 +11,7 @@ class InputPriceLabelExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Pricing\PricingSetting */ - private $pricingSetting; + protected $pricingSetting; /** * @param \Shopsys\FrameworkBundle\Model\Pricing\PricingSetting $pricingSetting diff --git a/packages/framework/src/Twig/Javascript/JavascriptCompiler.php b/packages/framework/src/Twig/Javascript/JavascriptCompiler.php index b3252c731ba..85ac73a194c 100644 --- a/packages/framework/src/Twig/Javascript/JavascriptCompiler.php +++ b/packages/framework/src/Twig/Javascript/JavascriptCompiler.php @@ -15,47 +15,47 @@ class JavascriptCompiler /** * @var string */ - private $webPath; + protected $webPath; /** * @var string */ - private $jsUrlPrefix; + protected $jsUrlPrefix; /** * @var string[] */ - private $allowedDirectories; + protected $allowedDirectories; /** * @var string[] */ - private $jsSourcePaths; + protected $jsSourcePaths; /** * @var \Symfony\Component\Filesystem\Filesystem */ - private $filesystem; + protected $filesystem; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @var \Shopsys\FrameworkBundle\Component\Javascript\Compiler\JsCompiler */ - private $jsCompiler; + protected $jsCompiler; /** * @var array */ - private $javascriptLinks = []; + protected $javascriptLinks = []; /** * @var \Symfony\Component\Asset\Packages */ - private $assetPackages; + protected $assetPackages; /** * @param string $webPath @@ -105,7 +105,7 @@ public function compile(array $javascripts) /** * @param string $javascript */ - private function process($javascript) + protected function process($javascript) { foreach ($this->jsSourcePaths as $jsSourcePath) { if ($this->tryToProcessJavascriptFile($jsSourcePath, $javascript)) { @@ -127,7 +127,7 @@ private function process($javascript) * @param string $javascript * @return bool */ - private function tryToProcessJavascriptFile($jsSourcePath, $javascript) + protected function tryToProcessJavascriptFile($jsSourcePath, $javascript) { $sourcePath = $jsSourcePath . '/' . $javascript; $relativeTargetPath = $this->getRelativeTargetPath($javascript); @@ -152,7 +152,7 @@ private function tryToProcessJavascriptFile($jsSourcePath, $javascript) * @param string $timestamp * @return string */ - private function getPathWithTimestamp($relativePath, $timestamp) + protected function getPathWithTimestamp($relativePath, $timestamp) { $version = '-v' . $timestamp; @@ -163,7 +163,7 @@ private function getPathWithTimestamp($relativePath, $timestamp) * @param string $javascript * @return string|null */ - private function getRelativeTargetPath($javascript) + protected function getRelativeTargetPath($javascript) { $relativeTargetPath = null; if ($this->isDirectoryAllowed($javascript)) { @@ -182,7 +182,7 @@ private function getRelativeTargetPath($javascript) * @param string $javascript * @return bool */ - private function isDirectoryAllowed(string $javascript): bool + protected function isDirectoryAllowed(string $javascript): bool { foreach ($this->allowedDirectories as $allowedDirectory) { if (strpos($javascript, $allowedDirectory) === 0) { @@ -196,7 +196,7 @@ private function isDirectoryAllowed(string $javascript): bool * @param string $sourceFilename * @param string $relativeTargetPath */ - private function compileJavascriptFile($sourceFilename, $relativeTargetPath) + protected function compileJavascriptFile($sourceFilename, $relativeTargetPath) { $compiledFilename = $this->webPath . '/' . $relativeTargetPath; @@ -219,7 +219,7 @@ private function compileJavascriptFile($sourceFilename, $relativeTargetPath) * @param string $sourceFilename * @return bool */ - private function isCompiledFileFresh($compiledFilename, $sourceFilename) + protected function isCompiledFileFresh($compiledFilename, $sourceFilename) { if (is_file($compiledFilename) && parse_url($sourceFilename, PHP_URL_HOST) === null) { $isCompiledFileFresh = filemtime($sourceFilename) < filemtime($compiledFilename); @@ -234,7 +234,7 @@ private function isCompiledFileFresh($compiledFilename, $sourceFilename) * @param string $directoryMask * @return bool */ - private function tryToProcessJavascriptDirectoryMask($jsSourcePath, $directoryMask) + protected function tryToProcessJavascriptDirectoryMask($jsSourcePath, $directoryMask) { $parts = explode('/', $directoryMask); $mask = array_pop($parts); @@ -254,7 +254,7 @@ private function tryToProcessJavascriptDirectoryMask($jsSourcePath, $directoryMa * @param string $filenameMask * @return bool */ - private function processJavascriptByMask($jsSourcePath, $path, $filenameMask) + protected function processJavascriptByMask($jsSourcePath, $path, $filenameMask) { $filepaths = (array)glob($jsSourcePath . '/' . $path . '/' . $filenameMask); foreach ($filepaths as $filepath) { @@ -269,7 +269,7 @@ private function processJavascriptByMask($jsSourcePath, $path, $filenameMask) * @param string $filenameMask * @return bool */ - private function isMaskValid($filenameMask) + protected function isMaskValid($filenameMask) { return $filenameMask === '' || strpos($filenameMask, '*') !== false; } @@ -277,7 +277,7 @@ private function isMaskValid($filenameMask) /** * @param string $javascriptUrl */ - private function processExternalJavascript($javascriptUrl) + protected function processExternalJavascript($javascriptUrl) { $this->javascriptLinks[] = $this->assetPackages->getUrl($javascriptUrl); } diff --git a/packages/framework/src/Twig/Javascript/JavascriptExtension.php b/packages/framework/src/Twig/Javascript/JavascriptExtension.php index dcbde3e37b4..029dd521167 100644 --- a/packages/framework/src/Twig/Javascript/JavascriptExtension.php +++ b/packages/framework/src/Twig/Javascript/JavascriptExtension.php @@ -11,7 +11,7 @@ class JavascriptExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Twig\Javascript\JavascriptCompiler */ - private $javascriptCompiler; + protected $javascriptCompiler; /** * @param \Shopsys\FrameworkBundle\Twig\Javascript\JavascriptCompiler $javascriptCompiler @@ -48,7 +48,7 @@ public function renderJavascripts($javascripts) * @param array $javascriptLinks * @return string */ - private function getHtmlJavascriptImports(array $javascriptLinks) + protected function getHtmlJavascriptImports(array $javascriptLinks) { $html = ''; foreach ($javascriptLinks as $javascriptLink) { diff --git a/packages/framework/src/Twig/LocalizationExtension.php b/packages/framework/src/Twig/LocalizationExtension.php index 90e93f85ede..458d8d9f3ee 100644 --- a/packages/framework/src/Twig/LocalizationExtension.php +++ b/packages/framework/src/Twig/LocalizationExtension.php @@ -11,12 +11,12 @@ class LocalizationExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Localization\Localization */ - private $localization; + protected $localization; /** * @var \Symfony\Component\Asset\Packages */ - private $assetPackages; + protected $assetPackages; /** * @param \Symfony\Component\Asset\Packages $assetPackages @@ -64,7 +64,7 @@ public function getLocaleFlagHtml($locale, $showTitle = true) * @param string $locale * @return string */ - private function getTitle($locale) + protected function getTitle($locale) { try { $title = $this->localization->getLanguageName($locale); diff --git a/packages/framework/src/Twig/MailerSettingExtension.php b/packages/framework/src/Twig/MailerSettingExtension.php index 4b2ce60a4b8..cb905018ae6 100644 --- a/packages/framework/src/Twig/MailerSettingExtension.php +++ b/packages/framework/src/Twig/MailerSettingExtension.php @@ -12,27 +12,27 @@ class MailerSettingExtension extends Twig_Extension /** * @var \Symfony\Component\DependencyInjection\ContainerInterface */ - private $container; + protected $container; /** * @var bool */ - private $isDeliveryDisabled; + protected $isDeliveryDisabled; /** * @var string */ - private $mailerMasterEmailAddress; + protected $mailerMasterEmailAddress; /** * @var string[] */ - private $mailerWhitelistExpressions; + protected $mailerWhitelistExpressions; /** * @var \Symfony\Component\Templating\EngineInterface */ - private $templating; + protected $templating; /** * @param \Symfony\Component\DependencyInjection\ContainerInterface $container diff --git a/packages/framework/src/Twig/ModuleExtension.php b/packages/framework/src/Twig/ModuleExtension.php index 3ad8e58fa6b..d37ab9f330c 100644 --- a/packages/framework/src/Twig/ModuleExtension.php +++ b/packages/framework/src/Twig/ModuleExtension.php @@ -11,7 +11,7 @@ class ModuleExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Module\ModuleFacade */ - private $moduleFacade; + protected $moduleFacade; /** * @param \Shopsys\FrameworkBundle\Model\Module\ModuleFacade $moduleFacade diff --git a/packages/framework/src/Twig/NumberFormatterExtension.php b/packages/framework/src/Twig/NumberFormatterExtension.php index a2de09541f9..4d85b2e0676 100644 --- a/packages/framework/src/Twig/NumberFormatterExtension.php +++ b/packages/framework/src/Twig/NumberFormatterExtension.php @@ -17,12 +17,12 @@ class NumberFormatterExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Localization\Localization */ - private $localization; + protected $localization; /** * @var \CommerceGuys\Intl\NumberFormat\NumberFormatRepositoryInterface */ - private $numberFormatRepository; + protected $numberFormatRepository; /** * @param \Shopsys\FrameworkBundle\Model\Localization\Localization $localization @@ -107,7 +107,7 @@ public function formatPercent($number, $locale = null) * @param string|null $locale * @return string */ - private function getLocale($locale = null) + protected function getLocale($locale = null) { if ($locale === null) { $locale = $this->localization->getLocale(); diff --git a/packages/framework/src/Twig/PriceExtension.php b/packages/framework/src/Twig/PriceExtension.php index 38f620078b6..f3d04688e27 100644 --- a/packages/framework/src/Twig/PriceExtension.php +++ b/packages/framework/src/Twig/PriceExtension.php @@ -26,27 +26,27 @@ class PriceExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Pricing\Currency\CurrencyFacade */ - private $currencyFacade; + protected $currencyFacade; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @var \Shopsys\FrameworkBundle\Model\Localization\Localization */ - private $localization; + protected $localization; /** * @var \CommerceGuys\Intl\NumberFormat\NumberFormatRepositoryInterface */ - private $numberFormatRepository; + protected $numberFormatRepository; /** * @var \CommerceGuys\Intl\Currency\CurrencyRepositoryInterface */ - private $intlCurrencyRepository; + protected $intlCurrencyRepository; /** * @param \Shopsys\FrameworkBundle\Model\Pricing\Currency\CurrencyFacade $currencyFacade @@ -231,7 +231,7 @@ public function priceWithCurrencyByCurrencyIdFilter(Money $price, int $currencyI * @param string|null $locale * @return string */ - private function formatCurrency(Money $price, Currency $currency, string $locale = null): string + protected function formatCurrency(Money $price, Currency $currency, string $locale = null): string { if ($locale === null) { $locale = $this->localization->getLocale(); @@ -250,7 +250,7 @@ private function formatCurrency(Money $price, Currency $currency, string $locale * @param string $locale * @return \CommerceGuys\Intl\Formatter\NumberFormatter */ - private function getNumberFormatter(string $locale): NumberFormatter + protected function getNumberFormatter(string $locale): NumberFormatter { $numberFormat = $this->numberFormatRepository->get($locale); $numberFormatter = new NumberFormatter($numberFormat, NumberFormatter::CURRENCY); @@ -287,7 +287,7 @@ public function getCurrencyCodeByDomainId(int $domainId): string * @param string $locale * @return string */ - private function getCurrencySymbolByDomainIdAndLocale(int $domainId, string $locale): string + protected function getCurrencySymbolByDomainIdAndLocale(int $domainId, string $locale): string { $currency = $this->currencyFacade->getDomainDefaultCurrencyByDomainId($domainId); $intlCurrency = $this->intlCurrencyRepository->get($currency->getCode(), $locale); @@ -309,7 +309,7 @@ public function getDefaultCurrencySymbol(): string * @param string $locale * @return string */ - private function getDefaultCurrencySymbolByLocale(string $locale): string + protected function getDefaultCurrencySymbolByLocale(string $locale): string { $currency = $this->currencyFacade->getDefaultCurrency(); $intlCurrency = $this->intlCurrencyRepository->get($currency->getCode(), $locale); @@ -333,7 +333,7 @@ public function getCurrencySymbolByCurrencyId(int $currencyId): string * @param string $locale * @return string */ - private function getCurrencySymbolByCurrencyIdAndLocale(int $currencyId, string $locale): string + protected function getCurrencySymbolByCurrencyIdAndLocale(int $currencyId, string $locale): string { $currency = $this->currencyFacade->getById($currencyId); $intlCurrency = $this->intlCurrencyRepository->get($currency->getCode(), $locale); diff --git a/packages/framework/src/Twig/ProductExtension.php b/packages/framework/src/Twig/ProductExtension.php index 97a4235c426..4cbf6a4b85a 100644 --- a/packages/framework/src/Twig/ProductExtension.php +++ b/packages/framework/src/Twig/ProductExtension.php @@ -13,12 +13,12 @@ class ProductExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Category\CategoryFacade */ - private $categoryFacade; + protected $categoryFacade; /** * @var \Shopsys\FrameworkBundle\Model\Product\ProductCachedAttributesFacade */ - private $productCachedAttributesFacade; + protected $productCachedAttributesFacade; /** * @param \Shopsys\FrameworkBundle\Model\Category\CategoryFacade $categoryFacade diff --git a/packages/framework/src/Twig/ProductVisibilityExtension.php b/packages/framework/src/Twig/ProductVisibilityExtension.php index 632b8a3d409..ece9c12c871 100644 --- a/packages/framework/src/Twig/ProductVisibilityExtension.php +++ b/packages/framework/src/Twig/ProductVisibilityExtension.php @@ -13,17 +13,17 @@ class ProductVisibilityExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Product\ProductVisibilityRepository */ - private $productVisibilityRepository; + protected $productVisibilityRepository; /** * @var \Shopsys\FrameworkBundle\Model\Pricing\Group\PricingGroupSettingFacade */ - private $pricingGroupSettingFacade; + protected $pricingGroupSettingFacade; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @param \Shopsys\FrameworkBundle\Model\Product\ProductVisibilityRepository $productVisibilityRepository diff --git a/packages/framework/src/Twig/RequestExtension.php b/packages/framework/src/Twig/RequestExtension.php index 61f856d8112..792a3c05223 100644 --- a/packages/framework/src/Twig/RequestExtension.php +++ b/packages/framework/src/Twig/RequestExtension.php @@ -11,7 +11,7 @@ class RequestExtension extends Twig_Extension /** * @var \Symfony\Component\HttpFoundation\RequestStack */ - private $requestStack; + protected $requestStack; /** * @param \Symfony\Component\HttpFoundation\RequestStack $requestStack @@ -64,7 +64,7 @@ public function getRoute() /** * @return array */ - private function getParamsFromRequest() + protected function getParamsFromRequest() { return $this->requestStack->getMasterRequest()->query->all(); } diff --git a/packages/framework/src/Twig/RouterExtension.php b/packages/framework/src/Twig/RouterExtension.php index f23077beaf0..476ae1fa4d4 100644 --- a/packages/framework/src/Twig/RouterExtension.php +++ b/packages/framework/src/Twig/RouterExtension.php @@ -12,7 +12,7 @@ class RouterExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Component\Router\DomainRouterFactory */ - private $domainRouterFactory; + protected $domainRouterFactory; /** * @param \Shopsys\FrameworkBundle\Component\Router\DomainRouterFactory $domainRouterFactory diff --git a/packages/framework/src/Twig/SeoExtension.php b/packages/framework/src/Twig/SeoExtension.php index 4551dc914c7..74b51d76841 100644 --- a/packages/framework/src/Twig/SeoExtension.php +++ b/packages/framework/src/Twig/SeoExtension.php @@ -11,12 +11,12 @@ class SeoExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\Seo\SeoSettingFacade */ - private $seoSettingFacade; + protected $seoSettingFacade; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @param \Shopsys\FrameworkBundle\Model\Seo\SeoSettingFacade $seoSettingFacade diff --git a/packages/framework/src/Twig/ShopInfoExtension.php b/packages/framework/src/Twig/ShopInfoExtension.php index 81c7750d85e..e1fbe02264d 100644 --- a/packages/framework/src/Twig/ShopInfoExtension.php +++ b/packages/framework/src/Twig/ShopInfoExtension.php @@ -11,12 +11,12 @@ class ShopInfoExtension extends \Twig_Extension /** * @var \Shopsys\FrameworkBundle\Model\ShopInfo\ShopInfoSettingFacade */ - private $shopInfoSettingFacade; + protected $shopInfoSettingFacade; /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @param \Shopsys\FrameworkBundle\Model\ShopInfo\ShopInfoSettingFacade $shopInfoSettingFacade @@ -45,7 +45,7 @@ public function getFunctions() /** * @return \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private function getDomain() + protected function getDomain() { // Twig extensions are loaded during assetic:dump command, // so they cannot be dependent on Domain service diff --git a/packages/framework/src/Twig/TranslationExtension.php b/packages/framework/src/Twig/TranslationExtension.php index 6d043d880cd..5e645380c74 100644 --- a/packages/framework/src/Twig/TranslationExtension.php +++ b/packages/framework/src/Twig/TranslationExtension.php @@ -82,7 +82,7 @@ public function transchoiceHtml(Twig_Environment $twig, $message, $count, array * @param array $elements * @return array */ - private function getEscapedElements(Twig_Environment $twig, array $elements) + protected function getEscapedElements(Twig_Environment $twig, array $elements) { $defaultEscapeFilterCallable = $twig->getFilter('escape')->getCallable(); $escapedElements = []; diff --git a/packages/framework/src/Twig/UploadedFileExtension.php b/packages/framework/src/Twig/UploadedFileExtension.php index 213312c3a13..d7f5a7a8691 100644 --- a/packages/framework/src/Twig/UploadedFileExtension.php +++ b/packages/framework/src/Twig/UploadedFileExtension.php @@ -13,17 +13,17 @@ class UploadedFileExtension extends Twig_Extension /** * @var \Shopsys\FrameworkBundle\Component\Domain\Domain */ - private $domain; + protected $domain; /** * @var \Shopsys\FrameworkBundle\Component\UploadedFile\UploadedFileFacade */ - private $uploadedFileFacade; + protected $uploadedFileFacade; /** * @var \Shopsys\FrameworkBundle\Twig\FileThumbnail\FileThumbnailExtension */ - private $fileThumbnailExtension; + protected $fileThumbnailExtension; /** * @param \Shopsys\FrameworkBundle\Component\Domain\Domain $domain