This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Ruim: | |
function emailClients(array $clients): void | |
{ | |
foreach ($clients as $client) { | |
$clientRecord = $db->find($client); | |
if ($clientRecord->isActive()) { | |
email($client); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Order | |
{ | |
public function calculateTotalSum(){/*...*/} | |
public function getItems(){/*...*/} | |
public function getItemCount(){/*...*/} | |
public function addItem($item){/*...*/} | |
public function deleteItem($item){/*...*/} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copy of Exponent snack example | |
// https://snack.expo.io/HJcgiI8kb | |
import React, { Component } from 'react'; | |
import { Text, View, FlatList, Dimensions, Button, StyleSheet } from 'react-native'; | |
const { width } = Dimensions.get('window'); | |
const style = { | |
justifyContent: 'center', | |
alignItems: 'center', |