saguitech / canary
Canary is a cleaner version of the PHP language, like SASS for CSS, or TypeScript to Javascript, etc.
v0.1-alpha1
2014-08-11 20:30 UTC
Requires
- php: >= 5.3
- simoneast/simple-ansi-colors: dev-master
This package is not auto-updated.
Last update: 2025-02-25 04:00:07 UTC
README
Canary is a cleaner version of the PHP language, for a faster development.
Warning: The current version is highly unstable, and is under development by SaguiTech's team. Don't use it for production.
Features
- Code without annoying semicolons;
- and the $ preceding variables.
Installation
You can be cloning this repository and build a PHP Archive (PHAR) using the box-project
$ git clone https://github.com/SaguiTech/Canary.git $ composer update $ php vendor/bin/box build $ chmod +x canary.phar $ mv canary.phar /usr/local/bin/canary
Check the installation:
$ canary --version
Example
file.cap
echo "hello!\n"
variableWithNumbers10 = 10
VariableA = 'yes'
varB = 'no'
if (VariableA == varB)
echo 'yes!'
else
echo 'no!'
Then run:
$ canary run file.cap
The output is (file.php):
<?php
echo "hello!\n";
$variableWithNumbers10 = 10;
$VariableA = 'yes';
$varB = 'no';
if ($VariableA == $varB)
echo 'yes!';
else
echo 'no!';
Other commands
$ canary run -h
Running the tests
$ php vendor/bin/phpunit --bootstrap vendor/autoload.php tests/
Warning
This code is not tested with many cases. It's under development.
Next steps
- Implement unit tests;
- Lexical analysis.