keboola / php-component

General library for PHP applications running in Keboola Connection environment
MIT License
0 stars 1 forks source link

Make "run" default action if missing in config #58

Closed tomasfejfar closed 5 years ago

tomasfejfar commented 5 years ago

In 7.0 run() is no longer ran from index.php, so it needs to be a default value if it is to work with empty config {}.

tomasfejfar commented 5 years ago

@odin, tohle jsem objevil, když jsem ještě upravoval ten PR do generátoru. Určitě by se to nemělo chovat jako teď (tj. Keboola\Component\Exception\BaseComponentException:Unknown sync action "", method does not exist in class). Buďto by to mělo vykysat na exception, že je to neplatný config nebo by to mělo mít default run.

odinuv commented 5 years ago

seriozne nevim, mam z toho ambivalentni pocity - na jednu stranu je to prijemny pro testy, na druhou stranu je to nerealisticka konfigurace, tak proc se s ni zaobirat?

tomasfejfar commented 5 years ago

Tak v tom případě by to mělo padat pokud ten "action" chybí. Ale teď že to vrátí '' je imho blbě a bylo to OK dřív tím,ž e se s tím nikde nepracovalo.

odinuv commented 5 years ago

no tak pak by tam nemelo byt return $this->getValue(['action'], ''); ale jen return $this->getValue(['action']);

tomasfejfar commented 5 years ago

Jo, přesně tak. Ten default je tam historicky už od začátku prázdný string.

odinuv commented 5 years ago

ale klidne se pojdme zeptat jeste nekoho jinyho jestli jit cestou a nebo b, protoze ja si fakt nejsem jistej

tomasfejfar commented 5 years ago

https://keboola.slack.com/archives/C02C3GZUS/p1552915339016300

odinuv commented 5 years ago

btw, vsim jsem si, ze https://github.com/keboola/php-component#migration-from-version-6-to-version-7 tady zustal run misto execute

tomasfejfar commented 5 years ago

Jo, přilepím fix k tomu, díky 👍