refactor: renamed namespace from Da\User to pcrt\User
Some checks failed
Build / build (ubuntu-latest, 7.4) (push) Has been cancelled
Build / build (ubuntu-latest, 8.0) (push) Has been cancelled
Build / build (ubuntu-latest, 8.1) (push) Has been cancelled
Build / build (ubuntu-latest, 8.2) (push) Has been cancelled
Build / build (ubuntu-latest, 8.3) (push) Has been cancelled
Build / build (ubuntu-latest, 8.4) (push) Has been cancelled

All PHP namespaces and related references have been updated from Da\User to pcrt\User throughout the codebase, including composer.json autoload settings and all source files. This change standardizes the project under the new pcrt\User namespace for improved clarity and maintainability.
This commit is contained in:
2025-10-15 10:22:32 +02:00
parent eba9671e1b
commit 1c1ce6ccff
208 changed files with 736 additions and 734 deletions

View File

@ -4,7 +4,7 @@ return [
'id' => 'yii2-test-console',
'basePath' => dirname(__DIR__),
'aliases' => [
'@Da/User' => dirname(dirname(dirname(__DIR__))) . '/src/User',
'@pcrt/User' => dirname(dirname(dirname(__DIR__))) . '/src/User',
'@tests' => dirname(dirname(__DIR__)),
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
@ -14,7 +14,7 @@ return [
'cache' => null,
'db' => require __DIR__ . '/db.php',
'authManager' => [
'class' => Da\User\Component\AuthDbManagerComponent::class,
'class' => pcrt\User\Component\AuthDbManagerComponent::class,
],
'i18n' => [
'translations' => [
@ -34,7 +34,7 @@ return [
'class' => yii\console\controllers\MigrateController::class,
'migrationPath' => null,
'migrationNamespaces' => [
'Da\User\Migration',
'pcrt\User\Migration',
],
],
],

View File

@ -1,22 +1,22 @@
<?php
use Da\User\Filter\TwoFactorAuthenticationEnforceFilter;
use pcrt\User\Filter\TwoFactorAuthenticationEnforceFilter;
return [
'id' => 'yii2-user-tests',
'basePath' => dirname(__DIR__),
'language' => 'en-US',
'aliases' => [
'@Da/User' => dirname(dirname(dirname(__DIR__))) . '/src/User',
'@pcrt/User' => dirname(dirname(dirname(__DIR__))) . '/src/User',
'@tests' => dirname(dirname(__DIR__)),
'@vendor' => VENDOR_DIR,
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'bootstrap' => ['Da\User\Bootstrap'],
'bootstrap' => ['pcrt\User\Bootstrap'],
'modules' => [
'user' => [
'class' => 'Da\User\Module',
'class' => 'pcrt\User\Module',
'administrators' => ['user'],
],
],

View File

@ -2,7 +2,7 @@
namespace app\controllers;
use Da\User\Filter\AccessRuleFilter;
use pcrt\User\Filter\AccessRuleFilter;
use yii\filters\AccessControl;
use yii\web\Controller;

View File

@ -6,6 +6,6 @@ use yii\test\ActiveFixture;
class AssignmentFixture extends ActiveFixture
{
public $modelClass = 'Da\User\Model\Assignment';
public $modelClass = 'pcrt\User\Model\Assignment';
public $tableName = 'auth_assignment';
}

View File

@ -6,6 +6,6 @@ use yii\test\ActiveFixture;
class PermissionFixture extends ActiveFixture
{
public $modelClass = 'Da\User\Model\Permission';
public $modelClass = 'pcrt\User\Model\Permission';
public $tableName = 'auth_item';
}

View File

@ -6,7 +6,7 @@ use yii\test\ActiveFixture;
class ProfileFixture extends ActiveFixture
{
public $modelClass = 'Da\User\Model\Profile';
public $modelClass = 'pcrt\User\Model\Profile';
public $depends = [
'tests\_fixtures\UserFixture',

View File

@ -6,7 +6,7 @@ use yii\test\ActiveFixture;
class TokenFixture extends ActiveFixture
{
public $modelClass = 'Da\User\Model\Token';
public $modelClass = 'pcrt\User\Model\Token';
public $depends = [
'tests\_fixtures\UserFixture',

View File

@ -6,5 +6,5 @@ use yii\test\ActiveFixture;
class UserFixture extends ActiveFixture
{
public $modelClass = 'Da\User\Model\User';
public $modelClass = 'pcrt\User\Model\User';
}

View File

@ -1,6 +1,6 @@
<?php
use Da\User\Model\Token;
use pcrt\User\Model\Token;
$time = time();

View File

@ -1,9 +1,9 @@
<?php
use Da\User\Model\Token;
use Da\User\Model\User;
use Da\User\Module;
use pcrt\User\Model\Token;
use pcrt\User\Model\User;
use pcrt\User\Module;
use tests\_fixtures\UserFixture;
use yii\helpers\Html;

View File

@ -18,7 +18,7 @@ $secondUser = $I->grabFixture('user', 'seconduser');
$adminUser = $I->grabFixture('user', 'admin');
$I->wantTo('Ensure that profile profile pages are shown only to when user has correct permissions and else forbidden');
Yii::$app->getModule('user')->profileVisibility = \Da\User\Controller\ProfileController::PROFILE_VISIBILITY_OWNER;
Yii::$app->getModule('user')->profileVisibility = \pcrt\User\Controller\ProfileController::PROFILE_VISIBILITY_OWNER;
Yii::$app->getModule('user')->administrators = ['admin'];
$I->amLoggedInAs($user);
@ -42,7 +42,7 @@ $I->see('Forbidden');
$I->dontSee('Joined on');
Yii::$app->getModule('user')->profileVisibility = \Da\User\Controller\ProfileController::PROFILE_VISIBILITY_ADMIN;
Yii::$app->getModule('user')->profileVisibility = \pcrt\User\Controller\ProfileController::PROFILE_VISIBILITY_ADMIN;
$I->amLoggedInAs($user);
$I->amGoingTo('Profile visibility::PROFILE_VISIBILITY_ADMIN: try to open users own profile page');
$I->amOnRoute('/user/profile/show', ['id' => $user->id]);
@ -71,7 +71,7 @@ $I->see('Forbidden');
$I->dontSee('Joined on');
Yii::$app->getModule('user')->profileVisibility = \Da\User\Controller\ProfileController::PROFILE_VISIBILITY_USERS;
Yii::$app->getModule('user')->profileVisibility = \pcrt\User\Controller\ProfileController::PROFILE_VISIBILITY_USERS;
$I->amLoggedInAs($user);
$I->amGoingTo('Profile visibility::PROFILE_VISIBILITY_USERS: try to open users own profile page');
$I->amOnRoute('/user/profile/show', ['id' => $user->id]);
@ -99,7 +99,7 @@ $I->expectTo('See the profile page');
$I->see('Forbidden');
$I->dontSee('Joined on');
Yii::$app->getModule('user')->profileVisibility = \Da\User\Controller\ProfileController::PROFILE_VISIBILITY_PUBLIC;
Yii::$app->getModule('user')->profileVisibility = \pcrt\User\Controller\ProfileController::PROFILE_VISIBILITY_PUBLIC;
Yii::$app->user->logout();
$I->amGoingTo('Profile visibility::PROFILE_VISIBILITY_PUBLIC: try to open users profile page as guest');

View File

@ -4,8 +4,8 @@
* @var Codeception\Scenario
*/
use Da\User\Model\Token;
use Da\User\Model\User;
use pcrt\User\Model\Token;
use pcrt\User\Model\User;
use tests\_fixtures\TokenFixture;
use tests\_fixtures\UserFixture;
use yii\helpers\Html;

View File

@ -1,9 +1,9 @@
<?php
use Da\User\Model\Token;
use Da\User\Model\User;
use Da\User\Module;
use pcrt\User\Model\Token;
use pcrt\User\Model\User;
use pcrt\User\Module;
use tests\_fixtures\UserFixture;
use yii\helpers\Html;

View File

@ -4,8 +4,8 @@
* @var Codeception\Scenario
*/
use Da\User\Model\Token;
use Da\User\Model\User;
use pcrt\User\Model\Token;
use pcrt\User\Model\User;
use tests\_fixtures\ProfileFixture;
use tests\_fixtures\UserFixture;
use yii\helpers\Html;
@ -51,7 +51,7 @@ $I->see('Invalid login or password');
$I->amGoingTo('log in using new email address after clicking the confirmation link');
$emailChangeService = Yii::createObject(\Da\User\Service\EmailChangeService::class, [$token->code, $user]);
$emailChangeService = Yii::createObject(\pcrt\User\Service\EmailChangeService::class, [$token->code, $user]);
$emailChangeService->run();
$I->fillField('#loginform-login', 'new_user@example.com');

View File

@ -1,6 +1,6 @@
<?php
use Da\User\Helper\SecurityHelper;
use pcrt\User\Helper\SecurityHelper;
use yii\base\Security;
/**

View File

@ -1,7 +1,7 @@
<?php
use Da\User\Helper\TimezoneHelper;
use Da\User\Validator\TimeZoneValidator;
use pcrt\User\Helper\TimezoneHelper;
use pcrt\User\Validator\TimeZoneValidator;
use yii\helpers\ArrayHelper;
/**