for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace phpbu\App\Adapter;
/**
* Adapter utility class
*
* @package phpbu
* @subpackage App
* @author Sebastian Feldmann <[email protected]>
* @copyright Sebastian Feldmann <[email protected]>
* @license https://opensource.org/licenses/MIT The MIT License (MIT)
* @link http://phpbu.de/
* @since Class available since Release 5.0.7
*/
abstract class Util
{
* Finds all adapter references in a value string.
* @param string $value
* @return array
public static function getAdapterReplacements(string $value) : array
$values = [];
$matches = [];
if (preg_match_all('#:?adapter:([a-z0-9_\-]+):([^:]+):?#i', $value, $matches, PREG_SET_ORDER)) {
foreach ($matches as $match) {
$values[] = [
'search' => $match[0],
'adapter' => $match[1],
'path' => $match[2]
];
}
return $values;