Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); /** * Passbolt ~ Open source password manager for teams ..
Decoded Output download
<?php
declare(strict_types=1);
/**
* Passbolt ~ Open source password manager for teams
* Copyright (c) Passbolt SA (https://www.passbolt.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
* @since 3.5.0
*/
namespace Passbolt\Folders\Test\Factory;
use App\Test\Factory\ResourceFactory as ResourceCoreFactory;
use Passbolt\Folders\FoldersPlugin;
use Passbolt\Folders\Model\Entity\Folder;
use Passbolt\Folders\Model\Entity\FoldersRelation;
/**
* ResourceFactory
*/
class ResourceFactory extends ResourceCoreFactory
{
public function initialize(): void
{
parent::initialize();
FoldersPlugin::addAssociationsToResourcesTable($this->getTable());
}
/**
* Define the associated folders relation to create for a given list of users.
*
* @param array $users Array of users to create the folder for
* @param Folder|null $folderParent The target folder parent
* @return ResourceFactory
*/
public function withFoldersRelationsFor(array $users, ?Folder $folderParent = null): ResourceFactory
{
foreach ($users as $user) {
$folderParentId = !is_null($folderParent) ? $folderParent->id : FoldersRelation::ROOT;
$folderRelationMeta = ['foreign_model' => FoldersRelation::FOREIGN_MODEL_RESOURCE, 'user_id' => $user->id, 'folder_parent_id' => $folderParentId];
$this->with('FoldersRelations', $folderRelationMeta);
}
return $this;
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
/**
* Passbolt ~ Open source password manager for teams
* Copyright (c) Passbolt SA (https://www.passbolt.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
* @since 3.5.0
*/
namespace Passbolt\Folders\Test\Factory;
use App\Test\Factory\ResourceFactory as ResourceCoreFactory;
use Passbolt\Folders\FoldersPlugin;
use Passbolt\Folders\Model\Entity\Folder;
use Passbolt\Folders\Model\Entity\FoldersRelation;
/**
* ResourceFactory
*/
class ResourceFactory extends ResourceCoreFactory
{
public function initialize(): void
{
parent::initialize();
FoldersPlugin::addAssociationsToResourcesTable($this->getTable());
}
/**
* Define the associated folders relation to create for a given list of users.
*
* @param array $users Array of users to create the folder for
* @param Folder|null $folderParent The target folder parent
* @return ResourceFactory
*/
public function withFoldersRelationsFor(array $users, ?Folder $folderParent = null): ResourceFactory
{
foreach ($users as $user) {
$folderParentId = !is_null($folderParent) ? $folderParent->id : FoldersRelation::ROOT;
$folderRelationMeta = ['foreign_model' => FoldersRelation::FOREIGN_MODEL_RESOURCE, 'user_id' => $user->id, 'folder_parent_id' => $folderParentId];
$this->with('FoldersRelations', $folderRelationMeta);
}
return $this;
}
}
Function Calls
None |
Stats
MD5 | 8bda8106e70ac89a6cae98c2fa3aaba7 |
Eval Count | 0 |
Decode Time | 97 ms |