jtrw / devutils
Libs for help to develop
Installs: 3 172
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
README
Install
composer require jtrw/devutils
Functions
dd(['test' => 1]);
Transliterate Convert cyr text to lat
$str = transliterate($str);
CliUtils
CliUtils::e('Some message'); // Output: [ERROR] Some message CliUtils::i('Some message'); // Output: [INFO] Some message CliUtils::s('Some message'); // Output: [OK] Some message CliUtils::w('Some message'); // Output: [WARNING] Some message
You can choose some color for text:
CliUtils::color('Some text', 'red');
Supported Colors:
- black
- dark_gray
- blue
- light_blue
- green
- light_green
- cyan
- light_cyan
- red
- light_red
- purple
- light_purple
- brown
- yellow
- light_gray
- white
LoggerTrait
Use
class SomeClass { use Jtrw\DevUtils\Logger\Traits\LoggerTrait; public function (LoggerInterface $logger) { $this->setLogger($logger) } public function doSome(array $params) { $this->i("Info for debug"); $this->d("Debug something", $params); try { //Some logic } catch (Exception $exp) { $this->logException($exp, LOG_CRIT, "Exception happened"); } } }