for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the League.csv library
*
* @license http://opensource.org/licenses/MIT
* @link https://github.com/thephpleague/csv/
* @version 9.0.0
* @package League.csv
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace League\Csv\Plugin;
use League\Csv\RecordFormatterInterface;
use League\Csv\RecordValidatorInterface;
* An Adapter Class to convert a callable into
* - an ValidatorInterface implementing object
* - an FormatterInterface implementing object
* @since 9.0.0
* @author Ignace Nyamagana Butera <[email protected]>
class CallableAdapter implements RecordValidatorInterface, RecordFormatterInterface
{
* @var callable
protected $callable;
* New instance
* @param callable $callable
public function __construct(callable $callable)
$this->callable = $callable;
}
* @inheritdoc
public function format(array $row): array
return ($this->callable)($row);
public function validate(array $row): bool