Chemaclass on v0.9.0
Chemaclass on update-changelog-date-for-0.9
Chemaclass on master
Set release 0.9 in changelog Merge pull request #566 from ph… (compare)
Chemaclass on update-changelog-date-for-0.9
Set release 0.9 in changelog (compare)
Chemaclass on simplify-api-facade
Chemaclass on master
ApiFacade returns a list of Phe… Add test_no_functions_found for… Update and apply phpcs and 1 more (compare)
Chemaclass on simplify-api-facade
Update and apply phpcs (compare)
Chemaclass on allow-underscores-in-decimal-numbers
Chemaclass on master
Allow decimal number with under… Refactor AtomParser applying ex… Update changelog and 5 more (compare)
my-type-with-two-interfaces
is a PHP class that implements the interfaces MyFirstInterface
and MySecondInterface
.
stripos(): Argument #1 ($haystack) must be of type string, null given
#0 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Domain\Repl\ReplCommandSystemIo.php(71): stripos(NULL, 'editline')
#1 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Command\ReplCommand.php(127): Phel\Run\Domain\Repl\ReplCommandSystemIo->isBracketedPasteSupported()
#2 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Command\ReplCommand.php(110): Phel\Run\Command\ReplCommand->addLineFromPromptToBuffer()
#3 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\src\php\Run\Command\ReplCommand.php(101): Phel\Run\Command\ReplCommand->loopReadLineAndAnalyze()
#4 D:\farid\phel\hello-world\vendor\symfony\console\Command\Command.php(298): Phel\Run\Command\ReplCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 D:\farid\phel\hello-world\vendor\symfony\console\Application.php(1015): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 D:\farid\phel\hello-world\vendor\symfony\console\Application.php(299): Symfony\Component\Console\Application->doRunCommand(Object(Phel\Run\Command\ReplCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 D:\farid\phel\hello-world\vendor\symfony\console\Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 D:\farid\phel\hello-world\vendor\phel-lang\phel-lang\phel(42): Symfony\Component\Console\Application->run()
#9 D:\farid\phel\hello-world\vendor\bin\phel(117): include('D:\\farid\\phel\\h...')
#10 {main}
SpecialForm
that I did miss a year ago when I was working on them, and I learned a lot by doing this. I found this now, so instead of doing them myself, I think it's good to let others try themselves if someone wants to contribute doing anything but they don't know where to start. These are like "exclusives testing katas" with a lot of learning opportunities :)
[33;34mPhel\Compiler\Domain\Evaluator\Exceptions\CompiledCodeIsMalformedException: [:div {:class "black-group"} [:h2 {:class "black-group-title"} "Expertise"] [[:div {:class "unit pb-4"} [:div {:class "unit-title"} "Laravel" [:br] [:span {:class "unit-subtitle"} " " "The best batteries-included PHP framework"]] [:div {:class "unit-intro"} "Still running my first Laravel 3 application in production environment."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "PHP" [:br] [:span {:class "unit-subtitle"} " " "It gets the job done"]] [:div {:class "unit-intro"} "My main programming language."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "JavaScript" [:br] [:span {:class "unit-subtitle"} " " "It is like wine"]] [:div {:class "unit-intro"} "The language gets better with years."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "React.js" [:br] [:span {:class "unit-subtitle"} " " "Simple top-down logic to follow"]] [:div {:class "unit-intro"} "My preferred JavaScript UI library."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "React-native" [:br] [:span {:class "unit-subtitle"} " " "Native mobile app development"]] [:div {:class "unit-intro"} "Web developers building native mobile apps with web technologies."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "Vue.js" [:br] [:span {:class "unit-subtitle"} " " "Alternative to React.js"]] [:div {:class "unit-intro"} "If you know React.js you know Vue.js."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "TypeScript" [:br] [:span {:class "unit-subtitle"} " " "TypeScript is JavaScript with syntax for types"]] [:div {:class "unit-intro"} "Whenever possible I try to use typescript and not use the any type."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "Phel" [:br] [:span {:class "unit-subtitle"} " " "Lisp inspired functional programming language that compiles to PHP"]] [:div {:class "unit-intro"} "This website is built with Phel."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "F#" [:br] [:span {:class "unit-subtitle"} " " "Strongly-typed, functional-first programming language"]] [:div {:class "unit-intro"} "This website javascript is written with F#/Fable."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "Go" [:br] [:span {:class "unit-subtitle"} " " "Small, simple, easy, powerful"]] [:div {:class "unit-intro"} "I like this language a lot, but have not used it very much."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "Elixir" [:br] [:span {:class "unit-subtitle"} " " "Dynamic, functional language for building scalable and maintainable applications"]] [:div {:class "unit-intro"} "Still reading the documentation and learning."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "Next.js" [:br] [:span {:class "unit-subtitle"} " " "The React Framework for Production"]] [:div {:class "unit-intro"} "SSR, SSG, ... A React.js framework with batteries included."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "NestJS" [:br] [:span {:class "unit-subtitle"} " " "Progressive Node.js framework for building server-side applications"]] [:div {:class "unit-intro"} "Backend framework but for Node.js. It supports TypeScript and JavaScript."] nil] [:div {:class "unit pb-4"} [:div {:class "unit-title"} "Nx" [:br] [:span {:class "unit-subtitle"} " " "Smart, Fast and Extensible Build System"]] [:div {:class "unit-intro"} "Used for building monorepos and other stuff."] nil]]] is not a valid element name.
In my index.php I have to manually switch from two modes. One for production and development and one for development.
public/index.php
<?php
declare(strict_types=1);
$projectRootDir = __DIR__ . '/../';
// Compiles Phel code to PHP on each request and then runs it (Slow).
// require $projectRootDir . 'vendor/autoload.php';
// Phel\Phel::run($projectRootDir, 'app\\boot');
// Runs previously compiled PHP code (Fast).
require_once $projectRootDir . "vendor/autoload.php";
require_once $projectRootDir . "dist/app/boot.php";
How could I tell the application to run in specific mode?
All done. Here is the contact form which is now 100% phel and the website is now on 0.7.0 version. If you disable form validation (add novalidate to form) you can see the server side validation and validation error display in action.
I have solved the issue when using compiled and non-compiled phel code:
composer.json
"scripts": {
"dev:slow": "PHEL_MODE=slow php -S localhost:8000 -t public/",
"dev:fast": "composer compile && PHEL_MODE=fast php -S localhost:8000 -t public/",
"compile": "vendor/bin/phel compile",
}
public/index.php
<?php
declare(strict_types=1);
$phelMode = getenv('PHEL_MODE');
file_put_contents("php://stdout", "\nPhel mode: $phelMode\n");
$projectRootDir = __DIR__ . '/../';
if ($phelMode === 'slow') {
// Compiles Phel code to PHP on each request and then runs it (Slow).
require $projectRootDir . 'vendor/autoload.php';
Phel\Phel::run($projectRootDir, 'app\\boot');
return;
}
// Runs previously compiled PHP code (Fast).
require_once $projectRootDir . "vendor/autoload.php";
require_once $projectRootDir . "dist/app/boot.php";
works great for now.