Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dvesh3 authored and github-actions[bot] committed Aug 22, 2022
1 parent 2fd4685 commit a0ca76a
Show file tree
Hide file tree
Showing 65 changed files with 0 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2696,7 +2696,6 @@ public function gridProxyAction(Request $request, EventDispatcherInterface $even

$assets = [];
foreach ($list->getAssets() as $index => $asset) {

// Like for treeGetChildsByIdAction, so we respect isAllowed method which can be extended (object DI) for custom permissions, so relying only users_workspaces_asset is insufficient and could lead security breach
if ($asset->isAllowed('list')) {
$a = Asset\Service::gridAssetData($asset, $allParams['fields'], $allParams['language'] ?? '');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ protected function getCalculatedColumnConfig($config)
{
try {
$calculatedColumnConfig = Tool\Session::useSession(function (AttributeBagInterface $session) use ($config) {

//otherwise create a new one

$calculatedColumn = [];
Expand Down Expand Up @@ -1626,7 +1625,6 @@ public function batchAction(Request $request)

$getter = 'get' . ucfirst($field);
if (method_exists($object, $getter)) {

/** @var DataObject\ClassDefinition\Data\Classificationstore $csFieldDefinition */
$csFieldDefinition = $object->getClass()->getFieldDefinition($field);
$csLanguage = $requestedLanguage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ protected function preSendDataActions(array &$data, Model\Document $document, ?V
*/
protected function addPropertiesToDocument(Request $request, Model\Document $document)
{

// properties
if ($request->get('properties')) {
$properties = [];
Expand Down
1 change: 0 additions & 1 deletion bundles/AdminBundle/Controller/Admin/ElementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ public function noteTypes(Request $request)
return $this->processNoteTypesFromParameters(PimcoreAdminExtension::PARAM_DATAOBJECTS_NOTES_EVENTS_TYPES);
default:
return $this->adminJson(['noteTypes' => []]);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/

namespace Pimcore\Bundle\AdminBundle\Controller\Admin\External {

use Pimcore\Bundle\AdminBundle\Controller\AdminController;
use Pimcore\Controller\KernelControllerEventInterface;
use Pimcore\Tool\Session;
Expand Down Expand Up @@ -163,7 +162,6 @@ protected function mergeAdminerHeaders(Response $response)
}

namespace {

use Pimcore\Cache;
use Pimcore\Tool\Session;

Expand Down
1 change: 0 additions & 1 deletion bundles/AdminBundle/Controller/Admin/LogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ static function () use ($fileData) {
);
$response->headers->set('Content-Type', 'text/plain');
} else {

// Fallback to local path when file is not found in flysystem that might still be using the constant

if (!filter_var($filePath, FILTER_VALIDATE_URL)) {
Expand Down
1 change: 0 additions & 1 deletion bundles/AdminBundle/Controller/Admin/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ public function twoFactorAuthenticationAction(Request $request, ?BruteforceProte
$params = $this->buildLoginPageViewParams($config);

if ($request->hasSession()) {

// we have to call the check here manually, because BruteforceProtectionListener uses the 'username' from the request
$bruteforceProtectionHandler?->checkProtection($this->getAdminUser()->getName(), $request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ public function wordExportAction(Request $request)
';

foreach ($definitions as $definition) {

// check allowed datatypes
if (!in_array($definition->getFieldtype(), ['input', 'textarea', 'wysiwyg'])) {
continue;
Expand Down
1 change: 0 additions & 1 deletion bundles/AdminBundle/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ public function getFilterCondition($filterJson, ClassDefinition $class, $tablePr
$brickDescriptor = null;
$isLocalized = false;
if (!$field) {

// if the definition doesn't exist check for a localized field
$localized = $class->getFieldDefinition('localizedfields');
if ($localized instanceof ClassDefinition\Data\Localizedfields) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

foreach ($tenants as $tenant) {

/** @var ProductCentricBatchProcessingWorker $worker */
$worker = $updater->getTenantWorker($tenant);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public function cleanupAction(Request $request)
throw $this->createNotFoundException('Could not get voucher series, probably you did not provide a correct id.');
}
if ($tokenManager = $onlineShopVoucherSeries->getTokenManager()) {

// Prepare cleanUp parameter array.
$params = ['id' => $request->get('id')]; // $request->query->all();
$request->get('usage') ? $params['usage'] = $request->get('usage') : '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ public function getReverseMappedFieldName($fullFieldName)
//search for part match in order to consider sub field names like name.analyzed
$fieldNamePart = $fullFieldName;
while (!empty($fieldNamePart)) {

// cut off part after last .
$fieldNamePart = substr($fieldNamePart, 0, strripos($fieldNamePart, '.'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,6 @@ protected function doLoadGroupByValues()
}

foreach ($this->preparedGroupByValues as $fieldname => $config) {

//exclude all attributes that are already filtered
$shortFieldname = $this->getTenantConfig()->getReverseMappedFieldName($fieldname);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ public function commitBatchToIndex(): void
['o_id' => $response[$operation]['_id'], 'tenant' => $this->name]
);
} else {

//update crc sums in store table to mark element as indexed
$this->db->executeQuery(
'UPDATE ' . $this->getStoreTableName() . ' SET crc_index = crc_current, update_status = ?, update_error = ?, metadata = ? WHERE o_id = ? and tenant = ?',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ protected function insertDataToIndex($data, $subObjectId)
$this->db->update($this->getStoreTableName(), $data, ['o_id' => (string)$subObjectId, 'tenant' => $this->name]);
});
} elseif ($currentEntry['in_preparation_queue']) {

//since no data has changed, just update flags, not data
$this->executeTransactionalQuery(function () use ($subObjectId) {
$this->db->executeQuery('UPDATE ' . $this->getStoreTableName() . ' SET in_preparation_queue = 0 WHERE o_id = ? AND tenant = ?', [$subObjectId, $this->name]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ protected function calculationFromGross(PriceInterface $price): PriceInterface

default:
throw new UnsupportedException('Combination Mode [' . $price->getTaxEntryCombinationMode() . '] cannot be recalculated.');

}

$price->setNetAmount($netAmount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public function check(EnvironmentInterface $environment)
foreach ($productsPool as $currentProduct) {
// check all valid products
foreach ($this->getProducts() as $product) {

/** @var Concrete $currentProductCheck */
$currentProductCheck = $currentProduct;
while ($currentProductCheck instanceof CheckoutableInterface) {
Expand Down
1 change: 0 additions & 1 deletion bundles/InstallBundle/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ public function insertDatabaseDump($file)
if (strpos($file, 'atomic') !== false) {
$db->executeStatement($dumpFile);
} else {

// get every command as single part - ; at end of line
$singleQueries = explode(";\n", $dumpFile);

Expand Down
1 change: 0 additions & 1 deletion lib/Console/Traits/Parallelization.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ trait Parallelization
use WebmozartParallelization
{
WebmozartParallelization::configureParallelization as parentConfigureParallelization;

}

protected static function configureParallelization(Command $command): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public function marshal($value, $params = [])
$encryptedValue2 = null;

if (is_array($value)) {

/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\EncryptedField $fd */
$fd = $params['fieldDefinition'];
$delegateFd = $fd->getDelegate();
Expand Down Expand Up @@ -88,7 +87,6 @@ public function marshal($value, $params = [])
public function unmarshal($value, $params = [])
{
if (is_array($value)) {

/** @var \Pimcore\Model\DataObject\ClassDefinition\Data\EncryptedField $fd */
$fd = $params['fieldDefinition'];
$delegateFd = $fd->getDelegate();
Expand Down
1 change: 0 additions & 1 deletion lib/Document/Editable/EditableHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ public function renderAreaFrontend(Info $info, $templateParams = []): string
*/
protected function handleBrickActionResult($result)
{

// if the action result is a response object, push it onto the
// response stack. this response will be used by the ResponseStackListener
// and sent back to the client
Expand Down
1 change: 0 additions & 1 deletion lib/Helper/ContrastColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class ContrastColor
*/
public static function getContrastColor($hexColor)
{

//////////// hexColor RGB
$R1 = hexdec(substr($hexColor, 1, 2));
$G1 = hexdec(substr($hexColor, 3, 2));
Expand Down
1 change: 0 additions & 1 deletion lib/Image/Adapter/Imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,6 @@ public function supportsFormat(string $format, bool $force = false)
}

if (!isset(self::$supportedFormatsCache[$format])) {

// since determining if an image format is supported is quite expensive we use two-tiered caching
// in-process caching (static variable) and the shared cache
$cacheKey = 'imagick_format_' . $format;
Expand Down
1 change: 0 additions & 1 deletion lib/Maintenance/Tasks/LogArchiveTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ public function execute()
if ($storage->fileExists($filePath)) {
$storage->delete($filePath);
} else {

// Fallback, if is not found and deleted in the flysystem, tries to delete from local
$fileRealPath = realpath($filePath);
if (str_starts_with(realpath($fileRealPath), PIMCORE_LOG_FILEOBJECT_DIRECTORY)) {
Expand Down
1 change: 0 additions & 1 deletion lib/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ public function __sleep()
*/
public function __call($method, $args)
{

// protected / private methods shouldn't be delegated to the dao -> this can have dangerous effects
if (!is_callable([$this, $method])) {
throw new \Exception("Unable to call private/protected method '" . $method . "' on object " . get_class($this));
Expand Down
1 change: 0 additions & 1 deletion lib/Tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ public static function getHttpData($url, $paramsGet = [], $paramsPost = [], $opt
}

if (is_array($paramsGet) && count($paramsGet) > 0) {

//need to insert get params from url to $paramsGet because otherwise they would be ignored
$urlParts = parse_url($url);

Expand Down
1 change: 0 additions & 1 deletion lib/Tool/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ public static function getMinimizedScriptPath($scriptContent)
*/
public static function determineCsvDialect($file)
{

// minimum 10 lines, to be sure take more
$sample = '';
for ($i = 0; $i < 10; $i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ protected function addBlocks(
$fieldDefinitions = $object->getClass()->getFieldDefinitions();
foreach ($fieldDefinitions as $fd) {
if ($fd instanceof DataObject\ClassDefinition\Data\Block) {

/** @var DataObject\ClassDefinition\Data\Localizedfields|null $blockLocalizedFieldDefinition */
$blockLocalizedFieldDefinition = $fd->getFieldDefinition('localizedfields');
if ($blockLocalizedFieldDefinition) {
Expand All @@ -260,7 +259,6 @@ protected function addBlocks(
if ($blockItems) {
foreach ($blockItems as $blockItem) {
if ($blockItem->getType() == 'localizedfields') {

/** @var DataObject\Localizedfield $blockItemData */
$blockItemData = $blockItem->getData();

Expand Down
1 change: 0 additions & 1 deletion lib/Workflow/Notification/NotificationEmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function sendWorkflowEmailNotification(array $users, array $roles, Workfl
$deeplink = '';
$hostUrl = Tool::getHostUrl();
if ($hostUrl !== '') {

// Decide what kind of link to create
$objectType = $type = 'object';
if ($subject instanceof \Pimcore\Model\Document) {
Expand Down
5 changes: 0 additions & 5 deletions models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ protected function getBlockedVars(): array
$blockedVars = ['scheduledTasks', 'hasChildren', 'versions', 'parent', 'stream'];

if (!$this->isInDumpState()) {

// for caching asset
$blockedVars = array_merge($blockedVars, ['children', 'properties']);
}
Expand Down Expand Up @@ -294,7 +293,6 @@ public static function getById($id, $force = false)
*/
public static function create($parentId, $data = [], $save = true)
{

// create already the real class for the asset type, this is especially for images, because a system-thumbnail
// (tree) is generated immediately after creating an image
$class = Asset::class;
Expand Down Expand Up @@ -625,7 +623,6 @@ public function correctPath()
{
// set path
if ($this->getId() != 1) { // not for the root node

if (!Element\Service::isValidKey($this->getKey(), 'asset')) {
throw new Exception("invalid filename '" . $this->getKey() . "' for asset with id [ " . $this->getId() . ' ]');
}
Expand Down Expand Up @@ -1780,11 +1777,9 @@ private function relocateThumbnails(string $oldPath)
}

if ($oldThumbnailsPath === $newThumbnailsPath) {

//path is equal, probably file name changed - so clear all thumbnails
$this->clearThumbnails(true);
} else {

//remove source parent folder preview thumbnails
$sourceFolder = Asset::getByPath(dirname($oldPath));
if ($sourceFolder) {
Expand Down
1 change: 0 additions & 1 deletion models/Asset/Dao.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@ public function isInheritingPermission(string $type, array $userIds): int
*/
public function isAllowed($type, $user)
{

// collect properties via parent - ids
$parentIds = [1];

Expand Down
2 changes: 0 additions & 2 deletions models/Asset/Image/Thumbnail/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ public static function process(Asset $asset, Config $config, $fileSystemPath = n

// after we got the lock, check again if the image exists in the meantime - if not - generate it
if (!$storage->fileExists($storagePath)) {

// all checks on the file system should be below the deferred part for performance reasons (remote file systems)
if (!$fileSystemPath) {
$fileSystemPath = $asset->getLocalFile();
Expand Down Expand Up @@ -359,7 +358,6 @@ public static function process(Asset $asset, Config $config, $fileSystemPath = n
foreach ($transformation['arguments'] as $key => $value) {
$position = array_search($key, $mapping);
if ($position !== false) {

// high res calculations if enabled
if (!in_array($transformation['method'], ['cropPercent']) && in_array($key,
['width', 'height', 'x', 'y'])) {
Expand Down
1 change: 0 additions & 1 deletion models/Asset/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public function __construct($user = null)
*/
public function copyRecursive($target, $source)
{

// avoid recursion
if (!$this->_copyRecursiveIds) {
$this->_copyRecursiveIds = [];
Expand Down
1 change: 0 additions & 1 deletion models/Asset/WebDAV/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public static function getDeleteLog()
*/
public static function saveDeleteLog($log)
{

// cleanup old entries
$tmpLog = [];
foreach ($log as $path => $data) {
Expand Down
3 changes: 0 additions & 3 deletions models/DataObject/AbstractObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@ public function save()
// this is especially useful to avoid problems with deadlocks in multi-threaded environments (forked workers, ...)
$maxRetries = 5;
for ($retries = 0; $retries < $maxRetries; $retries++) {

// be sure that unpublished objects in relations are saved also in frontend mode, eg. in importers, ...
$hideUnpublishedBackup = self::getHideUnpublished();
self::setHideUnpublished(false);
Expand Down Expand Up @@ -849,7 +848,6 @@ protected function correctPath()
{
// set path
if ($this->getId() != 1) { // not for the root node

if (!Element\Service::isValidKey($this->getKey(), 'object')) {
throw new \Exception('invalid key for object with id [ '.$this->getId().' ] key is: [' . $this->getKey() . ']');
}
Expand Down Expand Up @@ -1186,7 +1184,6 @@ public function getChildrenSortBy()
*/
public function __call($method, $args)
{

// compatibility mode (they do not have any set_oXyz() methods anymore)
if (preg_match('/^(get|set)o_/i', $method)) {
$newMethod = preg_replace('/^(get|set)o_/i', '$1', $method);
Expand Down
1 change: 0 additions & 1 deletion models/DataObject/ClassDefinition/Data/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,6 @@ public function classSaved($class, $params = [])
if (is_array($blockDefinitions)) {
foreach ($blockDefinitions as $field) {
if ($field instanceof LazyLoadingSupportInterface && $field->getLazyLoading()) {

// Lazy loading inside blocks isn't supported, turn it off if possible
if (method_exists($field, 'setLazyLoading')) {
$field->setLazyLoading(false);
Expand Down
2 changes: 0 additions & 2 deletions models/DataObject/ClassDefinition/Data/Numeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ class Numeric extends Data implements ResourcePersistenceAwareInterface, QueryRe
use Model\DataObject\Traits\SimpleComparisonTrait;
use Extension\ColumnType {
getColumnType as public genericGetColumnType;

}
use Extension\QueryColumnType {
getQueryColumnType as public genericGetQueryColumnType;

}

const DECIMAL_SIZE_DEFAULT = 64;
Expand Down
2 changes: 0 additions & 2 deletions models/DataObject/ClassDefinition/Data/QuantityValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ class QuantityValue extends Data implements ResourcePersistenceAwareInterface, Q
{
use Extension\ColumnType {
getColumnType as public genericGetColumnType;

}
use Extension\QueryColumnType {
getQueryColumnType as public genericGetQueryColumnType;

}
use Model\DataObject\Traits\DefaultValueTrait;

Expand Down
Loading

0 comments on commit a0ca76a

Please sign in to comment.