These are chat archives for lstrojny/functional-php

26th
Jun 2015
Martin Olsansky
@olso
Jun 26 2015 11:26
hey, i used composer to introduce functional-php to my project, however I am getting Functional class not found??
Lars Strojny
@lstrojny
Jun 26 2015 11:27
@olso can you show me your usage example?
Martin Olsansky
@olso
Jun 26 2015 11:28
use Functional\map as map;
Class 'Functional' not found
"lstrojny/functional-php": "~1.2@dev"
Lars Strojny
@lstrojny
Jun 26 2015 11:29
Try:
use function Functional\map;
Functional\map is a function, not a class
Martin Olsansky
@olso
Jun 26 2015 11:29
@lstrojny I see it in the vendor folder
use function is php56 only
i see composer min php now
@lstrojny but its the same with use Functional as F; which should work?
Lars Strojny
@lstrojny
Jun 26 2015 11:31
1.0 will work for you then
There you do this:
use Functional as F;

F\map([1, 2, 3], function() {});
Martin Olsansky
@olso
Jun 26 2015 11:31
@lstrojny 1.2 not using classes anymore?
Lars Strojny
@lstrojny
Jun 26 2015 11:32
1.0 didn’t either. use Functional as F just renames the namespace "Functional", not a class
Martin Olsansky
@olso
Jun 26 2015 11:34
@lstrojny it works now, it was actually my fault. I used static accessor
F::map
thanks