Skip to content
docsv0.24.0

Shell

Las dos cosas del mundo exterior que el tablero necesita: correr un proceso y traer una URL. Vive detrás de una clase para que los tests puedan sustituirla — un tablero cuyos tests salen a la red no se puede correr en CI y, peor, empieza a fallar por razones que no son suyas. Las dos devuelven `null` para decir "no pude", nunca una cadena vacía: vacío es una respuesta y no-pude no lo es, y confundirlas es exactamente lo que ADR-0028 prohíbe.

Shell::run()

public function run(array $command): ?string

Runs a command and returns its output, or null when it could not run. Null rather than an empty string on failure: a command that produced nothing and a command that never ran are different answers, and a check reading the second as the first would conclude something from an absence it caused.

Parameters

Parameters of run()
NameTypeDescription
$commandlist<string>

Shell::fetch()

public function fetch(string $url): ?string

Fetches a URL, or null when the network did not answer. Same distinction as {@see run()}: no answer is not an empty answer, and a board that treated an unreachable index as an empty one would report a package missing when it is merely offline.

Parameters

Parameters of fetch()
NameTypeDescription
$urlstring